From 357a7af1e82ae2ce4893535fa9e174e5a1d1d482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Thu, 24 Aug 2023 17:28:30 +0200 Subject: [PATCH] test sending CAN message --- .../app/factory/factory.c | 5 ++- .../middleware/can_interface.c | 8 +++++ 306-controller_interface.X/ss22ep.mc3 | 36 +++++++++---------- 3 files changed, 28 insertions(+), 21 deletions(-) diff --git a/306-controller_interface.X/app/factory/factory.c b/306-controller_interface.X/app/factory/factory.c index 3b149bb..9f9a3bc 100644 --- a/306-controller_interface.X/app/factory/factory.c +++ b/306-controller_interface.X/app/factory/factory.c @@ -52,10 +52,13 @@ void Factory_init() { LED_initHW(l8()); CAN_init(); + CAN_setSender(1); + LED_off(l1()); } void foo(uint8_t a, uint8_t b, uint32_t c){ - + LED_on(l1()); + CAN_Send(b, a, c); } //connect objects if required diff --git a/306-controller_interface.X/middleware/can_interface.c b/306-controller_interface.X/middleware/can_interface.c index cac0487..ea146cc 100644 --- a/306-controller_interface.X/middleware/can_interface.c +++ b/306-controller_interface.X/middleware/can_interface.c @@ -125,3 +125,11 @@ void CAN_Send(uint8_t idRecipient, uint8_t idMsg, uint32_t data) { tmpData = (tmpData<<32) | data; POST(&CAN_myself, &CAN_processEvent, evCAsend, 0, tmpData); } + +/*********** + * SETTERS * + ***********/ + +void CAN_setSender(uint8_t idSender) { + CAN_myself.sender = idSender; +} diff --git a/306-controller_interface.X/ss22ep.mc3 b/306-controller_interface.X/ss22ep.mc3 index 33d9ca8..e23ff38 100644 --- a/306-controller_interface.X/ss22ep.mc3 +++ b/306-controller_interface.X/ss22ep.mc3 @@ -1,4 +1,4 @@ - + @@ -16446,10 +16446,6 @@ 6 - - - 2 - 5 @@ -17166,63 +17162,63 @@ mcc_generated_files\mcc.h - a2db7e36e878f686c2bf0c2ef586ef1c6570fa2f27119b4be7b52af6403091a4 + aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9 mcc_generated_files\device_config.h - 89c6172ff575ce515b93f2fbc85dcedc2978e58a8e0e1fbdc52e42511ae3bc05 + 2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56 mcc_generated_files\interrupt_manager.h - 9c2f1ae45f2ac887bb3e8b3763e1a394a6a22ffe4e9ae1c20c336fe6f12da1aa + 313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955 mcc_generated_files\memory.c - 17fb4759c4719b77287f6c4be48edfbcf117b5b8398b771c434f23aceac256e0 + ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da mcc_generated_files\tmr0.h - 6661ab783aae9f11e952805f9bca14209ec06551939552123056eefd5524fff8 + 68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441 main.c - cae37ae3b36cf22e97e106633433f5c00a66dd5d38ec353eb67fbbb0d88bde4d + 91afd5df6694cfcd0279d66d9b5b3eb72a9c4eae825f0c0af82824e2ee66e35e mcc_generated_files\device_config.c - 39a6d1181ef5eab59c7dde2c52a9ea889465d4da43262200f3322abc45e77739 + 4288704a051756dce8bb92e77a82ba1285fc638cde56b3676b59406ba0fcea7b mcc_generated_files\pin_manager.h - 611a409602fd8fba29be052e06a3ce86ad0a3b723b5e0f4c1a998854de7f9a7b + 3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891 mcc_generated_files\tmr0.c - e0b4d075e819024ae77ea60a2c01182fdca45b783980cb50358d0a614736339d + f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9 mcc_generated_files\pin_manager.c - 04b16a3d3fcbbb333ee6fb545a405b76aba47ef3935be548bf2b8165c43c5654 + f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806 mcc_generated_files\ecan.c - ea62f50d319e1e537d7632774728ad6a779f442e896d043dbdea8066d028a6c6 + b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa mcc_generated_files\mcc.c - cc9ed44843b509879e6a3f676b561ecde91e1df88d855cf7eca77e1afc8920ca + 34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6 mcc_generated_files\interrupt_manager.c - df04edcd2c7d85ef90a8dbe4e46f1b1c9487b872153f4f2321249a4ce0d9635f + bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6 mcc_generated_files\ecan.h - aa9a50aae81bab76b876ea6123777af7d6a6d0a58fe953be27e8b88776395b2e + 0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26 mcc_generated_files\memory.h - fbbca4e9d7ce92ddcc637d82b694a1f5cbefa75710a8a18bb1dc9ab5161f0924 + 77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2 \ No newline at end of file