diff --git a/code/b-parasite/src/main.c b/code/b-parasite/src/main.c index 4c49e45..5c8f055 100644 --- a/code/b-parasite/src/main.c +++ b/code/b-parasite/src/main.c @@ -26,7 +26,7 @@ static void log_init(void) { static void gpio_init(void) { nrf_gpio_cfg_output(PRST_LED_PIN); nrf_gpio_cfg_output(PRST_FAST_DISCH_PIN); -#ifdef PRST_HAS_LDR +#if PRST_HAS_LDR nrf_gpio_cfg_output(PRST_PHOTO_V_PIN); #endif NRF_LOG_INFO("GPIO pins inited."); @@ -67,7 +67,7 @@ static void rtc_callback() { nrf_gpio_pin_clear(PRST_FAST_DISCH_PIN); uint16_t lux = 0; -#ifdef PRST_HAS_LDR +#if PRST_HAS_LDR nrf_gpio_pin_set(PRST_PHOTO_V_PIN); prst_adc_photo_sensor_t photo_read = prst_adc_photo_read(batt_read.voltage); nrf_gpio_pin_clear(PRST_PHOTO_V_PIN); diff --git a/code/b-parasite/src/prst/adc.h b/code/b-parasite/src/prst/adc.h index 2a733db..3b568b8 100644 --- a/code/b-parasite/src/prst/adc.h +++ b/code/b-parasite/src/prst/adc.h @@ -18,9 +18,8 @@ typedef struct prst_adc_soil_moisture { typedef struct prst_adc_photo_sensor { int16_t raw; - // A value from 0x0000 (no light) 0xffff (direct sun). - // Might need calibration. double voltage; + // Value in lux. uint16_t brightness; } prst_adc_photo_sensor_t;