diff --git a/fw/Makefile b/fw/Makefile index c9fcb52..df8b1d1 100644 --- a/fw/Makefile +++ b/fw/Makefile @@ -4,7 +4,7 @@ TARGET := main TARGET_MCU := CH32X035 TARGET_MCU_PACKAGE := CH32X035F8U6 BUILD_DIR := .build -DISPLAY := ssd1312 +DISPLAY := ssd1306_128x32 # include u8g2 U8G2_DIR:=u8g2/csrc diff --git a/fw/display.h b/fw/display.h index 0357c88..d01b089 100644 --- a/fw/display.h +++ b/fw/display.h @@ -3,10 +3,20 @@ #include -// #define SSD1306_128X32 1 -#define SSD1312_96X16 1 +#define SSD1306_128X32 1 +// #define SSD1312_96X16 1 #define PIN_DISP_RST PA7 // display reset +#ifdef SSD1306_128X32 +#define x_off 0 +#define y_off 0 +#endif + +#ifdef SSD1312_96X16 +#define x_off 0 +#define y_off 8 +#endif + u8g2_t* display_init(void); const char* i16toa(int16_t value); const char* u16toa(uint16_t value); diff --git a/fw/main.c b/fw/main.c index 53e11ec..b8cebbc 100644 --- a/fw/main.c +++ b/fw/main.c @@ -29,8 +29,6 @@ u8g2_t *u8g2; int16_t encoder = 0; // rotary encoder counter uint32_t last_interrupt = 0; // last time the encoder interrupt was triggered struct pd_profile_t pd_profile; -static const int8_t x_off = 0; -static const int8_t y_off = 8; // Convert the raw adc reading to a temperature in celsius with the ntc lut, // linearly interpolating between positions