From fef6567cfffc30ca3181679194a2f15cb19b2672 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Wed, 23 May 2012 23:02:14 -0500 Subject: [PATCH] Clock the SPI device with bytes. Image is now totally stable. --- flight/PiOS/inc/pios_video.h | 2 +- flight/board_hw_defs/osd/board_hw_defs.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/flight/PiOS/inc/pios_video.h b/flight/PiOS/inc/pios_video.h index 64782768c..10e6dd468 100644 --- a/flight/PiOS/inc/pios_video.h +++ b/flight/PiOS/inc/pios_video.h @@ -80,7 +80,7 @@ extern void PIOS_Vsync_ISR(); #define GRAPHICS_HEIGHT GRAPHICS_HEIGHT_REAL // dma lenght -#define BUFFER_LINE_LENGTH GRAPHICS_WIDTH //Yes, in 16 bit halfwords. +#define BUFFER_LINE_LENGTH (GRAPHICS_WIDTH*2) //Yes, in 16 bit halfwords. // line types #define LINE_TYPE_UNKNOWN 0 diff --git a/flight/board_hw_defs/osd/board_hw_defs.c b/flight/board_hw_defs/osd/board_hw_defs.c index 871380ed8..9bcaf6cb9 100644 --- a/flight/board_hw_defs/osd/board_hw_defs.c +++ b/flight/board_hw_defs/osd/board_hw_defs.c @@ -363,6 +363,7 @@ const struct pios_usb_cdc_cfg pios_usb_cdc_cfg = { #include static const struct pios_exti_cfg pios_exti_hsync_cfg __exti_config = { .vector = PIOS_Hsync_ISR, + .line = EXTI_Line7, .line = EXTI_Line2, .pin = { .gpio = GPIOD, @@ -430,7 +431,7 @@ static const struct pios_video_cfg pios_video_cfg = { .init = { .SPI_Mode = SPI_Mode_Master, .SPI_Direction = SPI_Direction_1Line_Tx, - .SPI_DataSize = SPI_DataSize_16b, + .SPI_DataSize = SPI_DataSize_8b, .SPI_NSS = SPI_NSS_Soft, .SPI_FirstBit = SPI_FirstBit_MSB, .SPI_CRCPolynomial = 7, @@ -480,7 +481,7 @@ static const struct pios_video_cfg pios_video_cfg = { .DMA_BufferSize = BUFFER_LINE_LENGTH, .DMA_PeripheralInc = DMA_PeripheralInc_Disable, .DMA_MemoryInc = DMA_MemoryInc_Enable, - .DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord, + .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte, .DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord, .DMA_Mode = DMA_Mode_Normal, .DMA_Priority = DMA_Priority_High, @@ -529,7 +530,7 @@ static const struct pios_video_cfg pios_video_cfg = { .init = { .SPI_Mode = SPI_Mode_Slave, .SPI_Direction = SPI_Direction_1Line_Tx, - .SPI_DataSize = SPI_DataSize_16b, + .SPI_DataSize = SPI_DataSize_8b, .SPI_NSS = SPI_NSS_Soft, .SPI_FirstBit = SPI_FirstBit_MSB, .SPI_CRCPolynomial = 7, @@ -577,7 +578,7 @@ static const struct pios_video_cfg pios_video_cfg = { .DMA_BufferSize = BUFFER_LINE_LENGTH, .DMA_PeripheralInc = DMA_PeripheralInc_Disable, .DMA_MemoryInc = DMA_MemoryInc_Enable, - .DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord, + .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte, .DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord, .DMA_Mode = DMA_Mode_Normal, .DMA_Priority = DMA_Priority_High,