
Ce programme emet la trame qui est censée réveiller le noeud 20 !!
Fork of CAN_ex_1 by
Revision 1:5791101761f9, committed 2017-01-20
- Comitter:
- mab5449
- Date:
- Fri Jan 20 11:39:47 2017 -0600
- Parent:
- 0:06f428d689e4
- Commit message:
- Tested the code on the LPC1768. Turns out no one implemented the driver for K64F. Also added a mbed conf file for portability. Note CAN is disconnected by default in my setup
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed_app.json | Show annotated file Show diff for this revision Revisions of this file |
diff -r 06f428d689e4 -r 5791101761f9 main.cpp --- a/main.cpp Thu Jan 19 14:21:14 2017 -0600 +++ b/main.cpp Fri Jan 20 11:39:47 2017 -0600 @@ -3,13 +3,13 @@ Ticker ticker; DigitalOut led1(LED1); DigitalOut led2(LED2); -CAN can1(p9, p10); -CAN can2(p30, p29); +CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD); +CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD); char counter = 0; void send() { printf("send()\n"); - if(can1.write(CANMessage(1337, &counter;, 1))) { + if(can1.write(CANMessage(1337, &counter, 1))) { printf("wloop()\n"); counter++; printf("Message sent: %d\n", counter); @@ -19,7 +19,7 @@ int main() { printf("main()\n"); - ticker.attach(&send;, 1); + ticker.attach(&send, 1); CANMessage msg; while(1) { printf("loop()\n");
diff -r 06f428d689e4 -r 5791101761f9 mbed_app.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed_app.json Fri Jan 20 11:39:47 2017 -0600 @@ -0,0 +1,29 @@ +{ + "config": { + "CAN1_rd": { + "help": "CAN1 rd pin", + "value": "NC" + }, + "CAN1_td": { + "help": "CAN1 td pin", + "value": "NC" + }, + "CAN2_rd": { + "help": "CAN2 rd pin", + "value": "NC" + }, + "CAN2_td": { + "help": "CAN2 td pin", + "value": "NC" + } + + }, + "target_overrides": { + "LPC1768": { + "CAN1_rd": "p9", + "CAN1_td": "p10", + "CAN2_rd": "p30", + "CAN2_td": "p29" + } + } +}