Skip to content

Commit 2031889

Browse files
MarekPietarlubos
authored andcommitted
applications: nrf_desktop: Align battery_def.h with nrfx 4.0
Change aligns battery_def.h configuration files used by nRF Desktop devices with nrfx 4.0. `NRF_SAADC_` macros can no longer be used here. Jira: NCSDK-36662 Signed-off-by: Marek Pieta <[email protected]> Signed-off-by: Jakub Zymelka <[email protected]> (cherry picked from commit 89bc0c0)
1 parent ac8adb6 commit 2031889

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

applications/nrf_desktop/configuration/nrf52840gmouse_nrf52840/battery_def.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
* and holds information about battery characteristic.
99
*/
1010

11+
#include <helpers/nrfx_analog_common.h>
12+
#include <zephyr/drivers/adc.h>
13+
1114
/* This structure enforces the header file is included only once in the build.
1215
* Violating this requirement triggers a multiple definition error at link time.
1316
*/
1417
const struct {} battery_def_include_once;
1518

16-
#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_AIN3
19+
#define BATTERY_MEAS_ADC_INPUT NRFX_ANALOG_EXTERNAL_AIN3
1720
#define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1
1821
#define BATTERY_MEAS_VOLTAGE_GAIN 1
1922

applications/nrf_desktop/configuration/nrf52dmouse_nrf52832/battery_def.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
* module and holds information about battery characteristic.
99
*/
1010

11+
#include <helpers/nrfx_analog_common.h>
12+
#include <zephyr/drivers/adc.h>
13+
1114
/* This structure enforces the header file is included only once in the build.
1215
* Violating this requirement triggers a multiple definition error at link time.
1316
*/
1417
const struct {} battery_def_include_once;
1518

16-
#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_AIN2
19+
#define BATTERY_MEAS_ADC_INPUT NRFX_ANALOG_EXTERNAL_AIN2
1720
#define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1_4
1821
#define BATTERY_MEAS_VOLTAGE_GAIN 4
1922

applications/nrf_desktop/configuration/nrf52kbd_nrf52832/battery_def.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
* module and holds information about battery characteristic.
99
*/
1010

11+
#include <helpers/nrfx_analog_common.h>
12+
#include <zephyr/drivers/adc.h>
13+
1114
/* This structure enforces the header file is included only once in the build.
1215
* Violating this requirement triggers a multiple definition error at link time.
1316
*/
1417
const struct {} battery_def_include_once;
1518

16-
#define BATTERY_MEAS_ADC_INPUT NRF_SAADC_INPUT_VDD
19+
#define BATTERY_MEAS_ADC_INPUT NRFX_ANALOG_INTERNAL_VDD
1720
#define BATTERY_MEAS_ADC_GAIN ADC_GAIN_1_6
1821
#define BATTERY_MEAS_VOLTAGE_GAIN 6
1922

0 commit comments

Comments
 (0)