IHM carte NBOARD Mai 2018
Dependents: NBoard_IHM_V2 ex20_fonction ex21_PWM1 ex26 ... more
Fork of IHM_V2 by
Diff: IHM.cpp
- Revision:
- 5:255e1428f05f
- Parent:
- 4:a9e51ac904e2
- Child:
- 6:ad91067e3f6d
diff -r a9e51ac904e2 -r 255e1428f05f IHM.cpp --- a/IHM.cpp Tue Nov 08 07:22:34 2016 +0000 +++ b/IHM.cpp Tue May 22 15:02:42 2018 +0000 @@ -8,7 +8,8 @@ IHM::IHM(PinName CANRx, PinName CANTx): can(CANRx,CANTx) { can.frequency(1000000); /*Baud rate : kbits/s */ - can.attach(this,&IHM::can_ISR_Reader); /* Fonction d'interruption CAN*/ + can.attach(callback(this,&IHM::can_ISR_Reader)); /* Fonction d'interruption CAN*/ +// can.attach(&IHM,&can_ISR_Reader); /* Fonction d'interruption CAN*/ Modif BL Mai 2018 } void IHM::LCD_printf(const char* format, ...) { @@ -53,6 +54,7 @@ // myled[0] = !myled[0]; // ledC= !ledC; } + can.write(CANMessage(2)); } void IHM::CAN_automate_reception(void) { @@ -178,9 +180,7 @@ UINT8 IHM::JOG_read(void) { - trame_Tx.id=JOG_REQ; - trame_Tx.type=CAN_REMOTE; - while(!can.write(trame_Tx)); + while(!can.write(CANMessage(JOG_REQ,CANStandard))); while(mise_a_jour_JOG==0) CAN_automate_reception(); @@ -203,11 +203,7 @@ UINT8 IHM::COD_read(void) { - trame_Tx.id=COD_REQ; - trame_Tx.type=CAN_REMOTE; - while(!can.write(trame_Tx)); - -// while(!can.write(CANMessage(COD_REQ,CANStandard))); + while(!can.write(CANMessage(COD_REQ,CANStandard))); while(mise_a_jour_COD==0) CAN_automate_reception(); mise_a_jour_COD=0;