Indentation fixes

This commit is contained in:
bsongis
2015-05-21 19:14:00 +02:00
parent 483cc6c190
commit 59235fcfcb
+12 -13
View File
@@ -39,7 +39,7 @@
void lcdSendCtl(uint8_t val) void lcdSendCtl(uint8_t val)
{ {
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_CS1); PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_CS1);
#ifdef LCD_MULTIPLEX #if defined(LCD_MULTIPLEX)
DDRA = 0xFF; //Set LCD_DAT pins to output DDRA = 0xFF; //Set LCD_DAT pins to output
#endif #endif
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_A0); PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_A0);
@@ -48,7 +48,7 @@ void lcdSendCtl(uint8_t val)
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_E); PORTC_LCD_CTRL |= (1<<OUT_C_LCD_E);
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_E); PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_E);
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0); PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
#ifdef LCD_MULTIPLEX #if defined(LCD_MULTIPLEX)
DDRA = 0x00; //Set LCD_DAT pins to input DDRA = 0x00; //Set LCD_DAT pins to input
#endif #endif
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_CS1); PORTC_LCD_CTRL |= (1<<OUT_C_LCD_CS1);
@@ -121,18 +121,18 @@ inline void lcdInit()
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RES); //LCD reset PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RES); //LCD reset
_delay_us(2); _delay_us(2);
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_RES); //LCD normal operation PORTC_LCD_CTRL |= (1<<OUT_C_LCD_RES); //LCD normal operation
#ifdef LCD_ST7920 #if defined(LCD_ST7920)
_delay_ms(40); _delay_ms(40);
#else #else
_delay_us(1500); _delay_us(1500);
#endif #endif
for (uint8_t i=0; i<DIM(lcdInitSequence); i++) { for (uint8_t i=0; i<DIM(lcdInitSequence); i++) {
lcdSendCtl(pgm_read_byte(&lcdInitSequence[i])) ; lcdSendCtl(pgm_read_byte(&lcdInitSequence[i])) ;
#ifdef LCD_ST7920 #if defined(LCD_ST7920)
_delay_us(80); _delay_us(80);
#endif #endif
} }
#ifdef LCD_ERC12864FSF #if defined(LCD_ERC12864FSF)
g_eeGeneral.contrast = 0x2D; g_eeGeneral.contrast = 0x2D;
#else #else
g_eeGeneral.contrast = 0x22; g_eeGeneral.contrast = 0x22;
@@ -142,7 +142,7 @@ inline void lcdInit()
void lcdSetRefVolt(uint8_t val) void lcdSetRefVolt(uint8_t val)
{ {
#ifndef LCD_ST7920 //No contrast setting for ST7920 #if !defined(LCD_ST7920) // No contrast setting for ST7920
LCD_LOCK(); LCD_LOCK();
lcdSendCtl(0x81); lcdSendCtl(0x81);
lcdSendCtl(val); lcdSendCtl(val);
@@ -153,7 +153,7 @@ void lcdSetRefVolt(uint8_t val)
void lcdRefresh() void lcdRefresh()
{ {
LCD_LOCK(); LCD_LOCK();
#ifdef LCD_ST7920 #if defined(LCD_ST7920)
uint8_t x_addr = 0; uint8_t x_addr = 0;
uint8_t y_addr = 0; uint8_t y_addr = 0;
uint16_t line_offset = 0; uint16_t line_offset = 0;
@@ -163,11 +163,11 @@ void lcdRefresh()
for (uint8_t y=0; y<64; y++) { for (uint8_t y=0; y<64; y++) {
x_addr = 0; x_addr = 0;
//Convert coordinates to weirdly-arranged 128x64 screen (the ST7920 is mapped for 256x32 displays) //Convert coordinates to weirdly-arranged 128x64 screen (the ST7920 is mapped for 256x32 displays)
if (y > 31) if (y > 31) {
{
y_addr = y - 32; //Because there are only 31 addressable lines in the ST7920 y_addr = y - 32; //Because there are only 31 addressable lines in the ST7920
x_addr += 8; //so we overflow x (7 visible bytes per line) to reach the bottom half x_addr += 8; //so we overflow x (7 visible bytes per line) to reach the bottom half
}else{ }
else {
y_addr = y; y_addr = y;
} }
lcdSendCtl( 0x80 | y_addr ); //Set Vertical Address lcdSendCtl( 0x80 | y_addr ); //Set Vertical Address
@@ -193,7 +193,7 @@ void lcdRefresh()
#else //All other LCD #else //All other LCD
uint8_t * p = displayBuf; uint8_t * p = displayBuf;
for (uint8_t y=0; y < 8; y++) { for (uint8_t y=0; y < 8; y++) {
#ifdef LCD_ST7565R #if defined(LCD_ST7565R)
lcdSendCtl(0x01); lcdSendCtl(0x01);
#else #else
lcdSendCtl(0x04); lcdSendCtl(0x04);
@@ -201,7 +201,7 @@ void lcdRefresh()
lcdSendCtl(0x10); // Column addr 0 lcdSendCtl(0x10); // Column addr 0
lcdSendCtl( y | 0xB0); //Page addr y lcdSendCtl( y | 0xB0); //Page addr y
PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_CS1); PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_CS1);
#ifdef LCD_MULTIPLEX #if defined(LCD_MULTIPLEX)
DDRA = 0xFF; // Set LCD_DAT pins to output DDRA = 0xFF; // Set LCD_DAT pins to output
#endif #endif
PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0); PORTC_LCD_CTRL |= (1<<OUT_C_LCD_A0);
@@ -217,4 +217,3 @@ void lcdRefresh()
#endif #endif
LCD_UNLOCK(); LCD_UNLOCK();
} }