Skip to content

Commit

Permalink
Force canmonitor check time to be 250ms and keep if clause commented …
Browse files Browse the repository at this point in the history
…since not working properly
  • Loading branch information
MSECode committed Jan 8, 2024
1 parent 141e34c commit 32ed955
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions emBODY/eBcode/arch-arm/board/bat/BAT_Rev_B/Src/BAT_B.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "BAT_B.h"

char Firmware_vers = 1;
char Revision_vers = 3;
char Build_number = 3;
char Revision_vers = 9;
char Build_number = 9;

uint32_t vtol=100; // voltage tolerance for hysteresis
uint32_t vhyst=0; // voltage hysteresis
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extern "C" {
#define EOMTHEEMSAPPLCFG_VERSION_MAJOR (VERSION_MAJOR_OFFSET+3)
// <o> minor <0-255>
// <o> minor <0-255>
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 97
#define EOMTHEEMSAPPLCFG_VERSION_MINOR 99

// </h>version

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct embot::app::eth::theBATservice::Impl {
CANmonitor canmonitor{};
static constexpr CANmonitor::Config defaultcanmonitorconfig{
{}, // the map is left empty
200 * embot::core::time1millisec,
250 * embot::core::time1millisec,
CANmonitor::Report::ALL,
10 * embot::core::time1second,
s_eobj_ownname,
Expand Down Expand Up @@ -476,11 +476,13 @@ eOresult_t embot::app::eth::theBATservice::Impl::Start() {
cfg.target.clear();
// check if we are not using custom value > 100 for service.servconfig.data.as.battery.canmonitorconfig.periodofcheck
// if not we are setting it to 250 in order to not having error when canmonitor checks for BAT frames
if(service.servconfig.data.as.battery.canmonitorconfig.periodofcheck == 0)
service.servconfig.data.as.battery.canmonitorconfig.periodofcheck = 250;
cfg.periodofcheck = embot::core::time1millisec * service.servconfig.data.as.battery.canmonitorconfig.periodofcheck;
cfg.periodofreport = embot::core::time1millisec * service.servconfig.data.as.battery.canmonitorconfig.periodofreport;
cfg.reportmode = static_cast<CANmonitor::Report>(service.servconfig.data.as.battery.canmonitorconfig.reportmode);
// if(service.servconfig.data.as.battery.canmonitorconfig.periodofcheck != 0)
// {
// cfg.periodofcheck = embot::core::time1millisec * service.servconfig.data.as.battery.canmonitorconfig.periodofcheck;
// cfg.periodofreport = embot::core::time1millisec * service.servconfig.data.as.battery.canmonitorconfig.periodofreport;
// cfg.reportmode = static_cast<CANmonitor::Report>(service.servconfig.data.as.battery.canmonitorconfig.reportmode);
// }

canmonitor.configure(cfg);
canmonitor.start();

Expand Down

0 comments on commit 32ed955

Please sign in to comment.