From 59235fcfcb380331b054b1e8f9c4782a90692c21 Mon Sep 17 00:00:00 2001 From: bsongis Date: Thu, 21 May 2015 19:14:00 +0200 Subject: [PATCH] Indentation fixes --- radio/src/targets/stock/lcd_driver.cpp | 173 ++++++++++++------------- 1 file changed, 86 insertions(+), 87 deletions(-) diff --git a/radio/src/targets/stock/lcd_driver.cpp b/radio/src/targets/stock/lcd_driver.cpp index a203dc7c6..1f9821913 100644 --- a/radio/src/targets/stock/lcd_driver.cpp +++ b/radio/src/targets/stock/lcd_driver.cpp @@ -39,7 +39,7 @@ void lcdSendCtl(uint8_t val) { PORTC_LCD_CTRL &= ~(1< 31) - { - 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 - }else{ - y_addr = y; - } - lcdSendCtl( 0x80 | y_addr ); //Set Vertical Address - _delay_us(49); - lcdSendCtl( 0x80 | x_addr ); //Set Horizontal Address - _delay_us(49); - PORTC_LCD_CTRL |= (1< 0=0, 1=1..7=7, 8=0, 9=1... - col_offset = 1 << bit_count; //Build a value for a AND operation with the vorrect bitposition - line_offset = ( y / 8 ) * 128; //On the ST7565 there are 8 lines with each 128 bytes width - for (coord_t x=0; x < 16; x++) { //Walk through 16 bytes form left to right (128 Pixel) - byte_offset = line_offset + ( x * 8 ); //Calculate the position of the first byte im array - //adressing the bytes sequential and shift the bits at the correct position, afterwards a OR operation to get all bits in one byte - //the position of the LSB is the left-most position of the byte to the ST7920 - PORTA_LCD_DAT = (((displayBuf[byte_offset] & col_offset) >> bit_count) << 7) | (((displayBuf[byte_offset + 1] & col_offset) >> bit_count) << 6) | (((displayBuf[byte_offset + 2] & col_offset) >> bit_count ) << 5) | (((displayBuf[byte_offset + 3] & col_offset) >> bit_count ) << 4) | (((displayBuf[byte_offset + 4] & col_offset) >> bit_count ) << 3) | (((displayBuf[byte_offset + 5] & col_offset) >> bit_count ) << 2) | (((displayBuf[byte_offset + 6] & col_offset) >> bit_count ) << 1) | (((displayBuf[byte_offset + 7] & col_offset) >> bit_count ) << 0); - PORTC_LCD_CTRL |= (1< 31) { + 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 + } + else { + y_addr = y; + } + lcdSendCtl( 0x80 | y_addr ); //Set Vertical Address + _delay_us(49); + lcdSendCtl( 0x80 | x_addr ); //Set Horizontal Address + _delay_us(49); + PORTC_LCD_CTRL |= (1< 0=0, 1=1..7=7, 8=0, 9=1... + col_offset = 1 << bit_count; //Build a value for a AND operation with the vorrect bitposition + line_offset = ( y / 8 ) * 128; //On the ST7565 there are 8 lines with each 128 bytes width + for (coord_t x=0; x<16; x++) { //Walk through 16 bytes form left to right (128 Pixel) + byte_offset = line_offset + ( x * 8 ); //Calculate the position of the first byte im array + // adressing the bytes sequential and shift the bits at the correct position, afterwards a OR operation to get all bits in one byte + // the position of the LSB is the left-most position of the byte to the ST7920 + PORTA_LCD_DAT = (((displayBuf[byte_offset] & col_offset) >> bit_count) << 7) | (((displayBuf[byte_offset + 1] & col_offset) >> bit_count) << 6) | (((displayBuf[byte_offset + 2] & col_offset) >> bit_count ) << 5) | (((displayBuf[byte_offset + 3] & col_offset) >> bit_count ) << 4) | (((displayBuf[byte_offset + 4] & col_offset) >> bit_count ) << 3) | (((displayBuf[byte_offset + 5] & col_offset) >> bit_count ) << 2) | (((displayBuf[byte_offset + 6] & col_offset) >> bit_count ) << 1) | (((displayBuf[byte_offset + 7] & col_offset) >> bit_count ) << 0); + PORTC_LCD_CTRL |= (1<0; --x) { - PORTA_LCD_DAT = *p++; - PORTC_LCD_CTRL |= (1<0; --x) { + PORTA_LCD_DAT = *p++; + PORTC_LCD_CTRL |= (1<