Updates #ifdef's to #if in main.c
This commit is contained in:
parent
e1f385adbd
commit
ef2bfcdadd
2 changed files with 3 additions and 4 deletions
|
|
@ -26,7 +26,7 @@ static void log_init(void) {
|
||||||
static void gpio_init(void) {
|
static void gpio_init(void) {
|
||||||
nrf_gpio_cfg_output(PRST_LED_PIN);
|
nrf_gpio_cfg_output(PRST_LED_PIN);
|
||||||
nrf_gpio_cfg_output(PRST_FAST_DISCH_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);
|
nrf_gpio_cfg_output(PRST_PHOTO_V_PIN);
|
||||||
#endif
|
#endif
|
||||||
NRF_LOG_INFO("GPIO pins inited.");
|
NRF_LOG_INFO("GPIO pins inited.");
|
||||||
|
|
@ -67,7 +67,7 @@ static void rtc_callback() {
|
||||||
nrf_gpio_pin_clear(PRST_FAST_DISCH_PIN);
|
nrf_gpio_pin_clear(PRST_FAST_DISCH_PIN);
|
||||||
|
|
||||||
uint16_t lux = 0;
|
uint16_t lux = 0;
|
||||||
#ifdef PRST_HAS_LDR
|
#if PRST_HAS_LDR
|
||||||
nrf_gpio_pin_set(PRST_PHOTO_V_PIN);
|
nrf_gpio_pin_set(PRST_PHOTO_V_PIN);
|
||||||
prst_adc_photo_sensor_t photo_read = prst_adc_photo_read(batt_read.voltage);
|
prst_adc_photo_sensor_t photo_read = prst_adc_photo_read(batt_read.voltage);
|
||||||
nrf_gpio_pin_clear(PRST_PHOTO_V_PIN);
|
nrf_gpio_pin_clear(PRST_PHOTO_V_PIN);
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,8 @@ typedef struct prst_adc_soil_moisture {
|
||||||
|
|
||||||
typedef struct prst_adc_photo_sensor {
|
typedef struct prst_adc_photo_sensor {
|
||||||
int16_t raw;
|
int16_t raw;
|
||||||
// A value from 0x0000 (no light) 0xffff (direct sun).
|
|
||||||
// Might need calibration.
|
|
||||||
double voltage;
|
double voltage;
|
||||||
|
// Value in lux.
|
||||||
uint16_t brightness;
|
uint16_t brightness;
|
||||||
} prst_adc_photo_sensor_t;
|
} prst_adc_photo_sensor_t;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue