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
Diff: CAN_asser.cpp
- Revision:
- 11:e8c4a1c6553d
- Parent:
- 9:2113adf37c66
diff -r efa507ba2b35 -r e8c4a1c6553d CAN_asser.cpp
--- a/CAN_asser.cpp Thu May 23 21:26:08 2019 +0000
+++ b/CAN_asser.cpp Mon May 27 17:42:53 2019 +0000
@@ -5,8 +5,23 @@
unsigned char pt_lecture_can = 0, pt_ecriture_can = 0;
int nb_msg_can = 0;
-CAN can(PB_8, PB_9,1000000);
-Serial dbug(USBTX, USBRX, 115200);
+CAN can(PB_8, PB_9,1000000);
+//Serial dbug(USBTX, USBRX, 115200); //PC
+Serial dbug(PA_0, PA_1, 9600); //Bluetooth
+
+//Propre fonction valeur absolue
+int val_abs(int a)
+{
+ if(a < 0)
+ return -1*a;
+ return a;
+}
+//Propre fonction qui saute des lignes pour dbug bluetooth
+void sauter_lignes(int nb_lignes)
+{
+ for(unsigned i=0; i<nb_lignes; ++i)
+ dbug.printf("\n\r");
+}
void can_init(void)
{
@@ -21,8 +36,8 @@
if(nb_msg_can > 6)
{
//dbug.printf("!!!!!! CAN BUFFER OVERFLOW !!!!!!!!\n");
- pt_lecture_can++;
- nb_msg_can--;
+ pt_lecture_can++;
+ nb_msg_can--;
}
}