Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed X-NUCLEO-IHM05A1
Diff: main.cpp
- Revision:
- 19:9680ebe86f4a
- Parent:
- 18:65707db67191
- Child:
- 20:8e5dd30b1b59
--- a/main.cpp Thu Feb 07 18:38:41 2019 +0000
+++ b/main.cpp Fri Feb 08 15:27:17 2019 +0000
@@ -87,18 +87,17 @@
void canrx()
{
- printf("CAN: in\n\r");
- while(1){
- if(can1.read(messageIn, filter))
+ while(1)
{
- printf("CAN: mess %d\n\r", (messageIn.data[0] + (messageIn.data[1] << 8) + (messageIn.data[2] << 16) + (messageIn.data[3] << 24)));
- printf("CANaacc: id %x \n\r ",messageIn.id);
-}
+ if(can1.read(messageIn, filter))
+ {
+ printf("CAN: mess %d\n\r", (messageIn.data[0] + (messageIn.data[1] << 8) + (messageIn.data[2] << 16) + (messageIn.data[3] << 24)));
+ printf("CANaacc: id %x \n\r ",messageIn.id);
+ }
}
}
-
/* Main ----------------------------------------------------------------------*/
int main()
@@ -120,14 +119,11 @@
button.rise(&button_int_handler);
- printf("DONE: Mobjhbtor Init\n\r");
+ printf("DONE: Motor Init\n\r");
// CAN Initialization
- //can1.reset();
- // can1.frequency(500000);
- //can1.attach(&can_rx_handler);
+ canrxa.start(canrx);
-canrxa.start(canrx);
printf("DONE: CAN Init\n\r");
motor->run(StepperMotor::FWD);
@@ -139,5 +135,3 @@
wait(1000);
}
}
-
-