diff --git a/CMakeLists.txt b/CMakeLists.txt index ec8785f3..1228d365 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.12) project(icub_firmware_shared - VERSION 1.25.1) + VERSION 1.26.0) find_package(YCM 0.11.0 REQUIRED) diff --git a/can/canProtocolLib/iCubCanProto_classes.h b/can/canProtocolLib/iCubCanProto_classes.h index 56b5ab1b..86f2541b 100644 --- a/can/canProtocolLib/iCubCanProto_classes.h +++ b/can/canProtocolLib/iCubCanProto_classes.h @@ -52,11 +52,12 @@ extern "C" { #define ICUBCANPROTO_CLASS_PERIODIC_ANALOGSENSOR 0x03 #define ICUBCANPROTO_CLASS_PERIODIC_SKIN 0x04 #define ICUBCANPROTO_CLASS_PERIODIC_INERTIALSENSOR 0x05 +#define ICUBCANPROTO_CLASS_PERIODIC_BATTERY 0x06 #define ICUBCANPROTO_CLASS_BOOTLOADER 0x07 // marco.accame: is this macro ICUBCANPROTO_CLASS_MAXNUM used? // if, so, after the addition of new class ICUBCANPROTO_CLASS_PERIODIC_INERTIALSENSOR, it should become 0x06 // (the ICUBCANPROTO_CLASS_BOOTLOADER is not strangely not counted). -#define ICUBCANPROTO_CLASS_MAXNUM 0x05 +#define ICUBCANPROTO_CLASS_MAXNUM 0x07 // - declaration of public user-defined types ------------------------------------------------------------------------- diff --git a/can/canProtocolLib/iCubCanProto_types.h b/can/canProtocolLib/iCubCanProto_types.h index cd879151..c265b1ff 100644 --- a/can/canProtocolLib/iCubCanProto_types.h +++ b/can/canProtocolLib/iCubCanProto_types.h @@ -76,6 +76,7 @@ extern "C" { #define ICUBCANPROTO_BOARDTYPE__MTB4W 16 #define ICUBCANPROTO_BOARDTYPE__PMC 17 #define ICUBCANPROTO_BOARDTYPE__AMCBLDC 18 +#define ICUBCANPROTO_BOARDTYPE__BMS 19 #define ICUBCANPROTO_BOARDTYPE__UNKNOWN 255 // skin types @@ -111,6 +112,7 @@ typedef enum icubCanProto_boardType__mtb4w = ICUBCANPROTO_BOARDTYPE__MTB4W, icubCanProto_boardType__pmc = ICUBCANPROTO_BOARDTYPE__PMC, icubCanProto_boardType__amcbldc = ICUBCANPROTO_BOARDTYPE__AMCBLDC, + icubCanProto_boardType__bms = ICUBCANPROTO_BOARDTYPE__BMS, icubCanProto_boardType__unknown = ICUBCANPROTO_BOARDTYPE__UNKNOWN } icubCanProto_boardType_t; diff --git a/eth/embobj/plus/comm-v2/icub/EoAnalogSensors.c b/eth/embobj/plus/comm-v2/icub/EoAnalogSensors.c index df815e2a..051e3d44 100644 --- a/eth/embobj/plus/comm-v2/icub/EoAnalogSensors.c +++ b/eth/embobj/plus/comm-v2/icub/EoAnalogSensors.c @@ -88,7 +88,8 @@ static const char * s_eoas_sensors_strings[] = "eoas_temperature", "eoas_psc_angle", "eoas_pos_angle", - "eoas_ft" + "eoas_ft", + "eoas_battery" }; EO_VERIFYsizeof(s_eoas_sensors_strings, eoas_sensors_numberof*sizeof(const char *)); @@ -426,13 +427,29 @@ extern const eObrd_info_t * eoas_temperature_setof_boardinfos_find(const eOas_te // static const eObrd_cantype_t s_eoas_ft_supportedboards_types[] = { eobrd_cantype_strain, eobrd_cantype_strain2 }; +static const eObrd_cantype_t s_eoas_bms_supportedboards_types[] = { eobrd_cantype_bms }; +extern uint8_t eoas_battery_supportedboards_numberof(void) +{ + return sizeof(s_eoas_bms_supportedboards_types)/sizeof(eObrd_cantype_t); +} + extern uint8_t eoas_ft_supportedboards_numberof(void) { return sizeof(s_eoas_ft_supportedboards_types)/sizeof(eObrd_cantype_t); } +extern eObrd_cantype_t eoas_battery_supportedboards_gettype(uint8_t pos) +{ + if(pos >= eoas_battery_supportedboards_numberof()) + { + return eobrd_cantype_none; + } + + return s_eoas_bms_supportedboards_types[pos]; +} + extern eObrd_cantype_t eoas_ft_supportedboards_gettype(uint8_t pos) { if(pos >= eoas_ft_supportedboards_numberof()) @@ -456,6 +473,20 @@ extern eObool_t eoas_ft_isboardvalid(eObrd_cantype_t boardtype) return eobool_false; } +extern eObool_t eoas_battery_isboardvalid(eObrd_cantype_t boardtype) +{ + for(uint8_t n=0; n