Skip to content

Commit

Permalink
feat: add infected typography & encrypted text
Browse files Browse the repository at this point in the history
  • Loading branch information
Otrebor671 committed Sep 19, 2024
1 parent 339c7cb commit 7394167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion firmware/main/drivers/oled_driver/oled_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

static const char* TAG = "oled_driver";

static bool encrypt = 0;
static bool typography = 0;

typedef union out_column_t {
uint32_t u32;
uint8_t u8[4];
Expand Down Expand Up @@ -99,7 +102,8 @@ void oled_driver_display_text(oled_driver_t* dev,
uint8_t seg = x;
uint8_t image[8];
for (uint8_t i = 0; i < _text_len; i++) {
memcpy(image, font8x8_basic_tr[(uint8_t) text[i]], 8);
memcpy(image, font8x8_basic_tr[(uint8_t) text[i] + encrypt] + typography,
8);
if (invert)
oled_driver_invert(image, 8);
if (dev->_flip)
Expand Down Expand Up @@ -801,3 +805,11 @@ void oled_driver_draw_modal_box(oled_driver_t* dev,

// oled_driver_show_buffer(dev);
}

void oled_driver_set_encrypt_value(bool value) {
encrypt = value;
}

void oled_driver_set_typography_value(bool value) {
typography = value;
}
3 changes: 3 additions & 0 deletions firmware/main/drivers/oled_driver/oled_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ void spi_hardware_scroll(oled_driver_t* dev, oled_driver_scroll_type_t scroll);
void oled_driver_draw_modal_box(oled_driver_t* dev,
int pos_x,
int modal_height);

void oled_driver_set_encrypt_value(bool value);
void oled_driver_set_typography_value(bool value);
#ifdef __cplusplus
}
#endif

0 comments on commit 7394167

Please sign in to comment.