Fixed bug in can.s: CAN->BTR |= -->> CAN->BTR =

This commit is contained in:
eddyem
2020-06-02 17:55:36 +03:00
parent 31aaaeccf6
commit e9b497f827
53 changed files with 3 additions and 3 deletions

View File

@@ -145,7 +145,7 @@ void CAN_setup(uint16_t speed){
CAN->MCR &=~ CAN_MCR_SLEEP; /* (3) */
CAN->MCR |= CAN_MCR_ABOM; /* allow automatically bus-off */
CAN->BTR |= 2 << 20 | 3 << 16 | (6000/speed - 1); /* (4) */
CAN->BTR = 2 << 20 | 3 << 16 | (6000/speed - 1); /* (4) */
CAN->MCR &=~ CAN_MCR_INRQ; /* (5) */
tmout = 16000000;
while((CAN->MSR & CAN_MSR_INAK)==CAN_MSR_INAK) if(--tmout == 0) break; /* (6) */

0
F0-nolib/CANbus_stepper/src/canstepper.bin Normal file → Executable file
View File