test sending CAN message

This commit is contained in:
Rémi Heredero 2023-08-24 17:28:30 +02:00
parent 6b32fbe46e
commit 357a7af1e8
3 changed files with 28 additions and 21 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -1,4 +1,4 @@
<config configName="default" projectName="ss22ep" configVersion="1.1" device="PIC18F26K83" deviceLibraryClass="com.microchip.mcc.mcu8.Mcu8PeripheralLibrary" coreVersion="5.4.4">
<config configName="default" projectName="ss22ep" configVersion="1.1" device="PIC18F25K83" deviceLibraryClass="com.microchip.mcc.mcu8.Mcu8PeripheralLibrary" coreVersion="5.4.4">
<usedPackages class="java.util.ArrayList"/>
<usedClasses class="java.util.TreeMap">
<entry>
@ -16446,10 +16446,6 @@
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG4L" settingAlias="BBSIZE" alias="BBSIZE_1024"/>
<value>6</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG4L" settingAlias="BBSIZE" alias="BBSIZE_16384"/>
<value>2</value>
</entry>
<entry>
<key class="com.microchip.mcc.core.tokenManager.OptionKey" moduleName="System Module" registerAlias="CONFIG4L" settingAlias="BBSIZE" alias="BBSIZE_2048"/>
<value>5</value>
@ -17166,63 +17162,63 @@
<generatedFileHashHistoryMap class="java.util.HashMap">
<entry>
<file>mcc_generated_files\mcc.h</file>
<hash>a2db7e36e878f686c2bf0c2ef586ef1c6570fa2f27119b4be7b52af6403091a4</hash>
<hash>aead6835bc73f4332d9abb5de6c2a40829de25cc98452c4c69960d51b52844e9</hash>
</entry>
<entry>
<file>mcc_generated_files\device_config.h</file>
<hash>89c6172ff575ce515b93f2fbc85dcedc2978e58a8e0e1fbdc52e42511ae3bc05</hash>
<hash>2f04b3ff01bbe49769634d389433c7010ffb45d0f2973898e33988be7ab07d56</hash>
</entry>
<entry>
<file>mcc_generated_files\interrupt_manager.h</file>
<hash>9c2f1ae45f2ac887bb3e8b3763e1a394a6a22ffe4e9ae1c20c336fe6f12da1aa</hash>
<hash>313560861c27e0a0b39b2bbb6a64ac2068fd1937dc0339d7303ff241bbb52955</hash>
</entry>
<entry>
<file>mcc_generated_files\memory.c</file>
<hash>17fb4759c4719b77287f6c4be48edfbcf117b5b8398b771c434f23aceac256e0</hash>
<hash>ae2dbb373f8f03dd013cde153de046ba7c3c41033c1dedb8545cde41837ca3da</hash>
</entry>
<entry>
<file>mcc_generated_files\tmr0.h</file>
<hash>6661ab783aae9f11e952805f9bca14209ec06551939552123056eefd5524fff8</hash>
<hash>68e2ba0f47166abd2da1a472d6a67bfde31f9be3edc8582ace93062a6a32f441</hash>
</entry>
<entry>
<file>main.c</file>
<hash>cae37ae3b36cf22e97e106633433f5c00a66dd5d38ec353eb67fbbb0d88bde4d</hash>
<hash>91afd5df6694cfcd0279d66d9b5b3eb72a9c4eae825f0c0af82824e2ee66e35e</hash>
</entry>
<entry>
<file>mcc_generated_files\device_config.c</file>
<hash>39a6d1181ef5eab59c7dde2c52a9ea889465d4da43262200f3322abc45e77739</hash>
<hash>4288704a051756dce8bb92e77a82ba1285fc638cde56b3676b59406ba0fcea7b</hash>
</entry>
<entry>
<file>mcc_generated_files\pin_manager.h</file>
<hash>611a409602fd8fba29be052e06a3ce86ad0a3b723b5e0f4c1a998854de7f9a7b</hash>
<hash>3e61569926ed5f184a2267965f2cf7ca26dc997d552c213ebd94dbd80da54891</hash>
</entry>
<entry>
<file>mcc_generated_files\tmr0.c</file>
<hash>e0b4d075e819024ae77ea60a2c01182fdca45b783980cb50358d0a614736339d</hash>
<hash>f9702dc8c67433ffc3b8db9e12ee3a73fb0b152a792d26f6c7a89a3846bc4fc9</hash>
</entry>
<entry>
<file>mcc_generated_files\pin_manager.c</file>
<hash>04b16a3d3fcbbb333ee6fb545a405b76aba47ef3935be548bf2b8165c43c5654</hash>
<hash>f8ace8a0b0d2a4f0ed3e209db056da57858e5a670ad7d514e44352d9187be806</hash>
</entry>
<entry>
<file>mcc_generated_files\ecan.c</file>
<hash>ea62f50d319e1e537d7632774728ad6a779f442e896d043dbdea8066d028a6c6</hash>
<hash>b60a119876875a2af386474d32176b8be0f47a074a2d8688e79251a2d7cdf6fa</hash>
</entry>
<entry>
<file>mcc_generated_files\mcc.c</file>
<hash>cc9ed44843b509879e6a3f676b561ecde91e1df88d855cf7eca77e1afc8920ca</hash>
<hash>34fadc3a271040b358215ec477acf3e135b77137f9a1cc96def75fc2936d3ad6</hash>
</entry>
<entry>
<file>mcc_generated_files\interrupt_manager.c</file>
<hash>df04edcd2c7d85ef90a8dbe4e46f1b1c9487b872153f4f2321249a4ce0d9635f</hash>
<hash>bb0eaf9aec0554de0106cff27f66e56ae02a40bbdcb68d4d58d8a0d84d8929f6</hash>
</entry>
<entry>
<file>mcc_generated_files\ecan.h</file>
<hash>aa9a50aae81bab76b876ea6123777af7d6a6d0a58fe953be27e8b88776395b2e</hash>
<hash>0473fedf57d1376193e049ba507abed0960af84f0e416bea25972c4dae59ca26</hash>
</entry>
<entry>
<file>mcc_generated_files\memory.h</file>
<hash>fbbca4e9d7ce92ddcc637d82b694a1f5cbefa75710a8a18bb1dc9ab5161f0924</hash>
<hash>77a34d015c961db9ed465b4ca2d85ba910fb030ca14c3c2854428ab0b9b6fac2</hash>
</entry>
</generatedFileHashHistoryMap>
</config>