From b194497bb703265e9a5f0e054ed7b069e2992202 Mon Sep 17 00:00:00 2001 From: RobertGawron Date: Thu, 12 Dec 2024 15:06:23 +0100 Subject: [PATCH] it works --- .../Application/Device/Src/Display.cpp | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Software/STM32F103RBTx/Application/Device/Src/Display.cpp b/Software/STM32F103RBTx/Application/Device/Src/Display.cpp index 203139be..19c9a032 100644 --- a/Software/STM32F103RBTx/Application/Device/Src/Display.cpp +++ b/Software/STM32F103RBTx/Application/Device/Src/Display.cpp @@ -16,6 +16,9 @@ uint16_t hackBuff[300][300] = {0}; +static const uint8_t U8G2_STATUS_OK = 1u; +static const uint8_t U8G2_STATUS_NOT_OK = 0u; + static const u8x8_display_info_t u8x8_st7735_128x128_display_info = { /* chip_enable_level = */ 0, @@ -112,7 +115,7 @@ uint8_t my_u8x8_d_st7735(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_p break; } - return 1; + return U8G2_STATUS_OK; } void my_u8g2_Setup_st7735(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb) @@ -145,36 +148,25 @@ void my_u8g2_Setup_st7735(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_msg_cb b uint8_t my_u8x8_byte_rtthread_4wire_hw_spi(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { - - // printf("%s %d\n", __FILE__, __LINE__); - return 1; + // Not used. Required by the u8g2 library, but this action is handled by the St7735DisplayDriver class. + return U8G2_STATUS_OK; } uint8_t my_u8x8_gpio_and_delay_rtthread(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr) { - - // printf("%s %d\n", __FILE__, __LINE__); - return 1; + // Not used. Required by the u8g2 library, but this action is handled by the St7735DisplayDriver class. + return U8G2_STATUS_OK; } namespace Device { Display::Display(Driver::IDisplayDriver &_displayDriver) : displayDriver(_displayDriver) // Display::Display() /*: U8G2(U8G2_R0)*/ { - // u8x8_Setup(getU8x8(), my_u8x8_d_sh1108_128x160, u8x8_cad_001, my_u8x8_byte_arduino_4wire_sw_spi, my_u8x8_gpio_and_delay_arduino); - - /*public: U8G2_st7735 _1_4W_HW_SPI(const u8g2_cb_t *rotation, uint8_t cs, uint8_t dc, uint8_t reset = U8X8_PIN_NONE) : U8G2() { - u8g2_Setup_st7735 _1(&u8g2, rotation, u8x8_byte_rtthread_4wire_hw_spi, u8x8_gpio_and_delay_rtthread); - u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset); - */ - const u8g2_cb_t *rotation = U8G2_R0; uint8_t cs; uint8_t dc; uint8_t reset = 0; // U8X8_PIN_NONE; my_u8g2_Setup_st7735(&u8g2, rotation, my_u8x8_byte_rtthread_4wire_hw_spi, my_u8x8_gpio_and_delay_rtthread); - printf("%s %d\n", __FILE__, __LINE__); - // u8x8_SetPin_4Wire_HW_SPI(getU8x8(), cs, dc, reset); } void Display::check()