Skip to content

Commit e62b850

Browse files
committed
fw/drivers/sf32lb52/display_jdi: use LPCLOCK for LPTIM
Otherwise LPTIM cannot be clocked in deepsleep, causing VCOM/xFRP to stop functioning. Scoped signals to verify they are on all the time now. Fixes #428 Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent 8d81c18 commit e62b850

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/fw/drivers/sf32lb52/display_jdi.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "bf0_hal.h"
3434
#include "bf0_hal_lcdc.h"
3535
#include "bf0_hal_lptim.h"
36+
#include "bf0_hal_rtc.h"
3637

3738
#define BYTE_222_TO_332(data) ((((data) & 0x30) << 2) | (((data) & 0x0c) << 1) | ((data) & 0x03))
3839
#define POWER_SEQ_DELAY_TIME (11)
@@ -92,8 +93,8 @@ static void prv_display_on() {
9293

9394
LPTIM_TypeDef *lptim = DISPLAY->vcom.lptim;
9495

95-
lptim->CFGR |= LPTIM_INTLOCKSOURCE_APBCLOCK;
96-
lptim->ARR = 3750000 / DISPLAY->vcom.freq_hz;
96+
lptim->CFGR |= LPTIM_INTCLOCKSOURCE_LPCLOCK;
97+
lptim->ARR = RC10K_FREQ / DISPLAY->vcom.freq_hz;
9798
lptim->CMP = lptim->ARR / 2;
9899
lptim->CR |= LPTIM_CR_ENABLE;
99100
lptim->CR |= LPTIM_CR_CNTSTRT;

0 commit comments

Comments
 (0)