Simplify MKS_MINI_12864 init (move 5ms to u8g seq.) (#15428)
This commit is contained in:
parent
b7a9481e01
commit
55b8547f04
@ -128,6 +128,7 @@
|
||||
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#define RGB_LED
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define LED_CONTROL_MENU
|
||||
#define NEOPIXEL_LED
|
||||
#undef NEOPIXEL_TYPE
|
||||
#define NEOPIXEL_TYPE NEO_RGB
|
||||
|
@ -130,10 +130,12 @@ static const uint8_t u8g_dev_uc1701_mini12864_HAL_data_start[] PROGMEM = {
|
||||
UC1701_INDICATOR(0), // indicator disable
|
||||
UC1701_ON(1), // display on
|
||||
UC1701_COLUMN_HI(0), // set upper 4 bit of the col adr to 0
|
||||
U8G_ESC_END, // end of sequence
|
||||
U8G_ESC_DLY(5) // delay 5 ms
|
||||
#else
|
||||
UC1701_COLUMN_ADR(0), // address 0
|
||||
#endif
|
||||
U8G_ESC_END // end of sequence
|
||||
#endif
|
||||
};
|
||||
|
||||
uint8_t u8g_dev_uc1701_mini12864_HAL_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) {
|
||||
@ -170,9 +172,6 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m
|
||||
case U8G_DEV_MSG_INIT:
|
||||
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
|
||||
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_init_seq);
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
u8g_Delay(5);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case U8G_DEV_MSG_STOP: break;
|
||||
@ -180,17 +179,11 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m
|
||||
case U8G_DEV_MSG_PAGE_NEXT: {
|
||||
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
|
||||
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
u8g_Delay(5);
|
||||
#endif
|
||||
u8g_WriteByte(u8g, dev, 0x0B0 | (2 * pb->p.page)); /* select current page */
|
||||
u8g_SetAddress(u8g, dev, 1); /* data mode */
|
||||
u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)pb->buf);
|
||||
u8g_SetChipSelect(u8g, dev, 0);
|
||||
u8g_WriteEscSeqP(u8g, dev, u8g_dev_uc1701_mini12864_HAL_data_start);
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
u8g_Delay(5);
|
||||
#endif
|
||||
u8g_WriteByte(u8g, dev, 0x0B0 | (2 * pb->p.page + 1)); /* select current page */
|
||||
u8g_SetAddress(u8g, dev, 1); /* data mode */
|
||||
u8g_WriteSequence(u8g, dev, pb->width, (uint8_t *)(pb->buf)+pb->width);
|
||||
@ -199,16 +192,10 @@ uint8_t u8g_dev_uc1701_mini12864_HAL_2x_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t m
|
||||
|
||||
case U8G_DEV_MSG_CONTRAST:
|
||||
u8g_SetChipSelect(u8g, dev, 1);
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
u8g_Delay(5);
|
||||
#endif
|
||||
u8g_SetAddress(u8g, dev, 0); /* instruction mode */
|
||||
u8g_WriteByte(u8g, dev, 0x081);
|
||||
u8g_WriteByte(u8g, dev, (*(uint8_t *)arg) >> 2);
|
||||
u8g_SetChipSelect(u8g, dev, 0);
|
||||
#if ENABLED(MKS_MINI_12864)
|
||||
u8g_Delay(5);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
return u8g_dev_pb16v1_base_fn(u8g, dev, msg, arg);
|
||||
|
Loading…
Reference in New Issue
Block a user