Restructure data objects, BREAKING backwards compatibility!

This was necessary as some IDs were used that are reserved in spec v0.4.

The also includes some additions to the Python parser script.
This commit is contained in:
Martin Jäger
2021-08-29 16:53:05 +02:00
parent ea53bc7628
commit a584bf8a7f
6 changed files with 808 additions and 782 deletions
+2
View File
@@ -19,5 +19,7 @@
#define BOARD_HAS_PWM_PORT DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), pwm_switch))
#define BOARD_HAS_LOAD_OUTPUT DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), load))
#define BOARD_HAS_USB_OUTPUT DT_NODE_EXISTS(DT_CHILD(DT_PATH(outputs), usb_pwr))
#define BOARD_HAS_TEMP_FETS DT_NODE_EXISTS(DT_CHILD(DT_PATH(adc_inputs), temp_fets))
#define BOARD_HAS_TEMP_BAT DT_NODE_EXISTS(DT_CHILD(DT_PATH(adc_inputs), temp_bat))
#endif /* BOARD_H_ */
+2 -3
View File
@@ -246,7 +246,7 @@ void daq_update()
load.power = load.bus->voltage * load.current;
#endif
#if DT_NODE_EXISTS(DT_CHILD(DT_PATH(adc_inputs), temp_bat))
#if BOARD_HAS_TEMP_BAT
// battery temperature calculation
float bat_temp = ntc_temp(ADC_POS(temp_bat), vref, ADC_GAIN(temp_bat));
@@ -262,8 +262,7 @@ void daq_update()
}
#endif
#if DT_NODE_EXISTS(DT_CHILD(DT_PATH(adc_inputs), temp_fets))
// MOSFET temperature calculation
#if BOARD_HAS_TEMP_FETS
dcdc.temp_mosfets = ntc_temp(ADC_POS(temp_fets), vref, ADC_GAIN(temp_fets));
#endif
+753 -743
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -27,9 +27,9 @@
#define ID_CONF 0x06 // configurable settings
#define ID_CAL 0x07 // calibration
#define ID_REPORT 0x0A // reports
#define ID_DFU 0x0D // device firmware upgrade
#define ID_RPC 0x0E // remote procedure calls
#define ID_PUB 0x0F // publication setup
#define ID_DFU 0x0F // device firmware upgrade
#define ID_PUB 0x100 // publication setup
#define ID_CTRL 0x8000 // control functions
/*
@@ -46,7 +46,7 @@
* Increment the version number each time any data object IDs stored in NVM are changed. Otherwise
* data might get corrupted.
*/
#define DATA_OBJECTS_VERSION 4
#define DATA_OBJECTS_VERSION 05
extern bool pub_serial_enable;
extern bool pub_can_enable;