Skip to content

Commit

Permalink
Fix LCD backlight PWM for basic
Browse files Browse the repository at this point in the history
  • Loading branch information
protocentralashwin committed Oct 28, 2024
1 parent 2d2e861 commit 12008a1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/src/hw_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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",
Expand All @@ -339,6 +344,7 @@ void hw_thread(void)
printk("Error %d: failed to set pulse width\n", ret);
// return 0;
}
#endif

for (;;)
{
Expand Down

0 comments on commit 12008a1

Please sign in to comment.