diff --git a/ssd1306.c b/ssd1306.c --- a/ssd1306.c +++ b/ssd1306.c @@ -83,7 +83,8 @@ void SSD1303_Init(void) { /* Generate a reset */ SSD_Reset_Low(); - for(u32 i=5000;--i;);//ÑÓʱ5uSÒÔÉÏ + uint32_t i ; + for(i=5000;--i;); SSD_Reset_High(); /************************************************* @@ -223,7 +224,8 @@ unsigned long SSD1303_OFF(void) { if(iS_SSD_On){ #ifdef DEBUG_UI - for(u32 i=0;iCCR &= ((u32)0xFFFFFFFE); + DMA1_Channel5->CCR &= ((uint32_t)0xFFFFFFFE); DMA1_Channel5->CNDTR = SSD1303_COLUMN_NUMBER+SSD1303_COLUMN_MARGIN_START + SSD1303_COLUMN_MARGIN_END; - DMA1_Channel5->CMAR = (u32)(SSD1303_Buffer+SSD1303_COLUMN_NUMBER*pageIndex - SSD1303_COLUMN_MARGIN_START); - DMA_SSD_1303->CCR |= ((u32)0x00000001); + DMA1_Channel5->CMAR = (uint32_t)(SSD1303_Buffer+SSD1303_COLUMN_NUMBER*pageIndex - SSD1303_COLUMN_MARGIN_START); + DMA_SSD_1303->CCR |= ((uint32_t)0x00000001); pageIndex++; #else SSD_A0_High(); - DMA_SSD_1303->CCR &= ((u32)0xFFFFFFFE); + DMA_SSD_1303->CCR &= ((uint32_t)0xFFFFFFFE); DMA_SSD_1303->CNDTR = SSD1303_COLUMN_NUMBER*SSD1303_PAGE_NUMBER;//+SSD1303_COLUMN_MARGIN_START + SSD1303_COLUMN_MARGIN_END; - DMA_SSD_1303->CMAR = (u32)(SSD1303_Buffer);//+SSD1303_COLUMN_NUMBER*pageIndex); + DMA_SSD_1303->CMAR = (uint32_t)(SSD1303_Buffer);//+SSD1303_COLUMN_NUMBER*pageIndex); //DMA_Cmd(DMA_SSD_1303, ENABLE); - DMA_SSD_1303->CCR |= ((u32)0x00000001); + DMA_SSD_1303->CCR |= ((uint32_t)0x00000001); // pageIndex++; pageIndex = SSD1303_PAGE_NUMBER; #endif @@ -389,7 +391,9 @@ unsigned long SSD1303_DrawBlock( unsigned char mask1 = (1<