From 12008a1a0fcc705d3cd23cea379d5dffb0ea1ab9 Mon Sep 17 00:00:00 2001 From: Ashwin K Whitchurch Date: Mon, 28 Oct 2024 10:18:03 +0530 Subject: [PATCH] Fix LCD backlight PWM for basic --- app/src/hw_module.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/hw_module.c b/app/src/hw_module.c index 6c73547..178d794 100644 --- a/app/src/hw_module.c +++ b/app/src/hw_module.c @@ -69,7 +69,10 @@ const struct device *const max30001_dev = DEVICE_DT_GET_ANY(maxim_max30001); const struct device *const afe4400_dev = DEVICE_DT_GET_ANY(ti_afe4400); const struct device *const max30205_dev = DEVICE_DT_GET_ANY(maxim_max30205); const struct device *fg_dev; + +#ifdef CONFIG_HEALTHYPI_DISPLAY_ENABLED static const struct pwm_dt_spec bl_led_pwm = PWM_DT_SPEC_GET(DT_ALIAS(bl_led_pwm)); +#endif uint8_t global_batt_level = 0; @@ -326,6 +329,8 @@ void hw_thread(void) usb_init(); +#ifdef CONFIG_HEALTHYPI_DISPLAY_ENABLED + // PWM for LCD Backlight if (!pwm_is_ready_dt(&bl_led_pwm)) { printk("Error: PWM device %s is not ready\n", @@ -339,6 +344,7 @@ void hw_thread(void) printk("Error %d: failed to set pulse width\n", ret); // return 0; } +#endif for (;;) {