bugfix: backlight control

This commit is contained in:
Peter D. Gray 2023-08-15 12:57:04 -04:00 committed by scgbckbone
parent d6e8404560
commit 67fe10b128
4 changed files with 21 additions and 2 deletions

View File

@ -357,4 +357,12 @@ void *realloc(void *ptr, size_t size)
return m_realloc(ptr, size);
}
void led_state_OMIT(int led, int state)
{
// A number of files in ports/stm32 include leds.h and then
// call led_state() directly. This prevents us from using that LED
// for LCD backlight control, which we want because they've figured out
// the PWM nicely... so see mpconfigboard.mk where we hack in this no-op.
}
// EOF

View File

@ -125,4 +125,10 @@ extern void psramdisk_USBD_MSC_RegisterStorage(int num_lun, struct _usbd_cdc_msc
// enable some code inside oofatfs that we need
#define FF_USE_FASTSEEK (1)
// LEDs -- used for LCD backlight
#define MICROPY_HW_LED1 (pin_E3)
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
#define MICROPY_HW_LED1_PWM { TIM3, 3, TIM_CHANNEL_1, GPIO_AF2_TIM3 }
// EOF

View File

@ -86,7 +86,13 @@ build-COLDCARD_Q1/lib/stm32lib/CMSIS/STM32L4xx/Source/Templates/system_stm32l4xx
# bugfix: replace keyboard interrupt handling
build-COLDCARD_Q1/lib/utils/interrupt_char.o: \
CFLAGS += -Dmp_hal_set_interrupt_char=mp_hal_set_interrupt_char_OMIT
# bugfix: leave my LED's alone
build-COLDCARD_Q1/flashbdev.o: CFLAGS += -Dled_state=led_state_OMIT
build-COLDCARD_Q1/spibdev.o: CFLAGS += -Dled_state=led_state_OMIT
build-COLDCARD_Q1/factoryreset.o: CFLAGS += -Dled_state=led_state_OMIT
build-COLDCARD_Q1/boardctrl.o: CFLAGS += -Dled_state=led_state_OMIT
files:
# SRC_C: $(SRC_C)

View File

@ -1 +0,0 @@
../../external/micropython/lib/stm32lib/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tsc.