summaryrefslogtreecommitdiff
path: root/src/ssd1306_display_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ssd1306_display_driver.c')
-rw-r--r--src/ssd1306_display_driver.c41
1 files changed, 1 insertions, 40 deletions
diff --git a/src/ssd1306_display_driver.c b/src/ssd1306_display_driver.c
index 0e7d4cc..0bff3b0 100644
--- a/src/ssd1306_display_driver.c
+++ b/src/ssd1306_display_driver.c
@@ -20,7 +20,7 @@
void screen_init() {
#ifdef DEBUG_BUILD
- printf("initlizing SSD1306 display driver\n");
+ printf("initlizing SSD1306 display driver\r\n");
#endif
//turn on screen while we configure shit, it might look cooler
i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xaf);
@@ -86,42 +86,3 @@ void screen_update() {
}
}
-#ifdef DEBUG_BUILD
-//ugly code below
-
-void scroll_test() {
- //sets scroll area to whole screen
- i2c_write_reg_multi(SSD1306_ADDR, SSD1306_CMD_REG, 3, (uint8_t[]){0xa3, 0x00, 0x20});
- //set up scroll options
- i2c_write_reg_multi(SSD1306_ADDR, SSD1306_CMD_REG, 6, (uint8_t[]){0x29, 0x00, 0x00, 0x00, 0x04, 0x00});
- //actually activate scroll
- i2c_write_reg_multi(SSD1306_ADDR, SSD1306_CMD_REG, 6, (uint8_t[]){0x2f});
-}
-
-void screen_testdraw() {
- unsigned int on_pix;
- unsigned int on_page;
-
- printf("running screen time tests\n");
- printf("generating test image...\n");
- for(on_pix = 0; on_pix < sizeof(screen_buffer); on_pix++)
- screen_buffer[on_pix] = ((uint8_t)0xaa << (on_pix % 8));
-
- printf("page mode, individual byte per i2c call...\n");
- for(on_page = 0; on_page < SCREEN_PAGE_CNT; on_page++) {
- i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xb0 + on_page);
- i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x00);
- i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x10);
- for(on_pix = 0; on_pix < SCREEN_RES_X; on_pix++)
- i2c_write_reg(SSD1306_ADDR, SSD1306_DATA_REG, screen_buffer[(on_page * 8) + on_pix]);
- }
- printf("page mode, 1 page per i2c call...\n");
- for(on_page = 0; on_page < SCREEN_PAGE_CNT; on_page++) {
- i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xb0 + on_page);
- i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x00);
- i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x10);
- i2c_write_reg_multi(SSD1306_ADDR, SSD1306_DATA_REG, SCREEN_RES_X, &screen_buffer[on_page * SCREEN_RES_X]);
- }
-}
-
-#endif