Updates #ifdef's to #if in main.c

This commit is contained in:
rbaron 2021-09-22 22:43:49 +02:00
parent e1f385adbd
commit ef2bfcdadd
2 changed files with 3 additions and 4 deletions

View file

@ -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);

View file

@ -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;