Skip to content

Commit

Permalink
Updated error detection on hardware break signal
Browse files Browse the repository at this point in the history
No longer printing errors on console as it can interfere with regular communication
fastuart command can be called with "0" to switch back to 115200
  • Loading branch information
jsphuebner committed Nov 8, 2018
1 parent 5c267f4 commit 1db8c60
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions include/project/errormessage_prj.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
ERROR_MESSAGE_ENTRY(CANTIMEOUT, ERROR_DISPLAY) \
ERROR_MESSAGE_ENTRY(EMCYSTOP, ERROR_STOP) \
ERROR_MESSAGE_ENTRY(MPROT, ERROR_STOP) \
ERROR_MESSAGE_ENTRY(DESAT, ERROR_STOP) \
ERROR_MESSAGE_ENTRY(OVERVOLTAGE, ERROR_STOP) \
ERROR_MESSAGE_ENTRY(ENCODER, ERROR_DISPLAY) \
ERROR_MESSAGE_ENTRY(PRECHARGE, ERROR_STOP) \
Expand Down
2 changes: 1 addition & 1 deletion include/project/param_prj.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#define CAT_CHARGER "Charger"
#define CAT_COMM "Communication"

#define VER 4.75
#define VER 4.78
#define VERCEIL VER + 0.009

enum _modes
Expand Down
6 changes: 4 additions & 2 deletions src/project/pwmgeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ extern "C" void tim1_brk_isr(void)
DigIo::Set(Pin::err_out);
tripped = true;

if (!DigIo::Get(Pin::emcystop_in))
if (!DigIo::Get(Pin::emcystop_in) && hwRev != HW_REV3)
ErrorMessage::Post(ERR_EMCYSTOP);
else if (!DigIo::Get(Pin::mprot_in))
ErrorMessage::Post(ERR_MPROT);
else
else if (!DigIo::Get(Pin::desat_in) && hwRev != HW_REV1)
ErrorMessage::Post(ERR_DESAT);
else if (!DigIo::Get(Pin::ocur_in) || hwRev == HW_REV1)
ErrorMessage::Post(ERR_OVERCURRENT);
}

Expand Down
2 changes: 1 addition & 1 deletion src/project/stm32_sine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static void SelectDirection()
static void Ms100Task(void)
{
DigIo::Toggle(Pin::led_out);
ErrorMessage::PrintNewErrors();
//ErrorMessage::PrintNewErrors();
iwdg_reset();
s32fp cpuLoad = FP_FROMINT(PwmGeneration::GetCpuLoad() + scheduler->GetCpuLoad());
Param::SetFlt(Param::cpuload, cpuLoad / 10);
Expand Down
7 changes: 4 additions & 3 deletions src/project/terminal_prj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,9 @@ static void Reset(char *arg)

static void FastUart(char *arg)
{
arg = arg;
arg = my_trim(arg);
int baud = arg[0] == '0' ? USART_BAUDRATE : 921600;
printf("OK\r\n");
printf("Baud rate now 921600\r\n");
usart_set_baudrate(TERM_USART, 921600);
printf("Baud rate now %d\r\n", baud);
usart_set_baudrate(TERM_USART, baud);
}

0 comments on commit 1db8c60

Please sign in to comment.