Skip to content

Commit

Permalink
fixed ssd1306 tile writing
Browse files Browse the repository at this point in the history
  • Loading branch information
olikraus committed Oct 26, 2015
1 parent 1287050 commit 26cfebd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
3 changes: 3 additions & 0 deletions u8g2/csrc/u8x8_d_ssd1306_128x64_noname.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ uint8_t u8x8_d_ssd1306_128x64_noname(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int,
{
c = ((u8x8_tile_t *)arg_ptr)->cnt;
ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
u8x8_cad_SendData(u8x8, c*8, ptr); /* note: SendData can not handle more than 255 bytes */
/*
do
{
u8x8_cad_SendData(u8x8, 8, ptr);
ptr += 8;
c--;
} while( c > 0 );
*/
arg_int--;
} while( arg_int > 0 );

Expand Down
11 changes: 1 addition & 10 deletions u8g2/csrc/u8x8_d_uc1701_dogs102.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,7 @@ uint8_t u8x8_d_uc1701_dogs102(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *
{
c = ((u8x8_tile_t *)arg_ptr)->cnt;
ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;

u8x8_cad_SendData(u8x8, c*8, ptr);
/*
do
{
u8x8_cad_SendData(u8x8, 8, ptr);
ptr += 8;
c--;
} while( c > 0 );
*/
u8x8_cad_SendData(u8x8, c*8, ptr); /* note: SendData can not handle more than 255 bytes */
arg_int--;
} while( arg_int > 0 );

Expand Down
10 changes: 5 additions & 5 deletions u8g2/sys/arduino/test/test.ino
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ void u8x8_Setup_SSD1306_128x64_NONAME(u8x8_t *u8x8)
/* setup specific callbacks */
u8x8->display_cb = u8x8_d_ssd1306_128x64_noname;
u8x8->cad_cb = u8x8_cad_001;
//u8x8->byte_cb = u8x8_byte_arduino_hw_spi;
u8x8->byte_cb = u8x8_byte_8bit_sw_spi;
u8x8->byte_cb = u8x8_byte_arduino_hw_spi;
//u8x8->byte_cb = u8x8_byte_8bit_sw_spi;
u8x8->gpio_and_delay_cb = u8x8_gpio_and_delay_arduino;

/* setup display info */
Expand All @@ -197,14 +197,14 @@ uint8_t tile[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0 };

void setup(void)
{
u8x8_Setup_UC1701_DOGS102(&u8g2);
//u8x8_Setup_SSD1306_128x64_NONAME(&u8g2);
//u8x8_Setup_UC1701_DOGS102(&u8g2);
u8x8_Setup_SSD1306_128x64_NONAME(&u8g2);
}

void loop(void)
{
u8x8_display_Init(&u8g2);
u8x8_display_SetFlipMode(&u8g2, 1);
//u8x8_display_SetFlipMode(&u8g2, 1);


for(;;)
Expand Down

0 comments on commit 26cfebd

Please sign in to comment.