From c7cbd02ce252746f11a4af35c5cd6b5da8016c26 Mon Sep 17 00:00:00 2001 From: Abha Agrawal Date: Fri, 23 Mar 2018 20:25:57 -0400 Subject: [PATCH 1/2] brake message to CAN --- LPC Projects/pwmdemodulator/src/pwmdemodulator.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LPC Projects/pwmdemodulator/src/pwmdemodulator.c b/LPC Projects/pwmdemodulator/src/pwmdemodulator.c index e0502e0..4a9f953 100644 --- a/LPC Projects/pwmdemodulator/src/pwmdemodulator.c +++ b/LPC Projects/pwmdemodulator/src/pwmdemodulator.c @@ -153,6 +153,12 @@ void TIMER16_1_IRQHandler(void) if (BrakeRiseTime != 0) { brake = CurrentTimer > PWM_SWITCH_THRESHOLD; + msg_obj.msgobj = 0; + msg_obj.mode_id = 0x200; + msg_obj.mask = 0x0; + msg_obj.dlc = 1; + msg_obj.data[0] = 0x00 | brake; + LPC_CCAN_API->can_transmit(&msg_obj); } } LPC_TIMER16_1->TC = 0; From 14ab6781155e41122f68ae7ac8a555c981db1494 Mon Sep 17 00:00:00 2001 From: Abha Agrawal Date: Fri, 23 Mar 2018 20:30:30 -0400 Subject: [PATCH 2/2] changed msgobj in brakes --- LPC Projects/pwmdemodulator/src/pwmdemodulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LPC Projects/pwmdemodulator/src/pwmdemodulator.c b/LPC Projects/pwmdemodulator/src/pwmdemodulator.c index 4a9f953..da19acc 100644 --- a/LPC Projects/pwmdemodulator/src/pwmdemodulator.c +++ b/LPC Projects/pwmdemodulator/src/pwmdemodulator.c @@ -153,7 +153,7 @@ void TIMER16_1_IRQHandler(void) if (BrakeRiseTime != 0) { brake = CurrentTimer > PWM_SWITCH_THRESHOLD; - msg_obj.msgobj = 0; + msg_obj.msgobj = 1; msg_obj.mode_id = 0x200; msg_obj.mask = 0x0; msg_obj.dlc = 1;