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

0
F0-nolib/Chiller/chiller.bin Normal file → Executable file
View File

0
F0-nolib/F0_testbrd/pl2303.bin Normal file → Executable file
View File

0
F0-nolib/QuadEncoder/encoder.bin Normal file → Executable file
View File

0
F0-nolib/Servo/servo.bin Normal file → Executable file
View File

0
F0-nolib/TM1637/tm1637.bin Normal file → Executable file
View File

0
F0-nolib/USBHID/usbhid.bin Normal file → Executable file
View File

0
F0-nolib/blink/blink.bin Normal file → Executable file
View File

View File

@@ -135,7 +135,7 @@ void CAN_setup(){
CAN->MCR &=~ CAN_MCR_SLEEP; /* (3) */
CAN->MCR |= CAN_MCR_ABOM;
CAN->BTR |= 2 << 20 | 3 << 16 | 59 << 0; /* (4) */
CAN->BTR = 2 << 20 | 3 << 16 | 59 << 0; /* (4) */
CAN->MCR &=~ CAN_MCR_INRQ; /* (5) */
while((CAN->MSR & CAN_MSR_INAK)==CAN_MSR_INAK) /* (6) */
{

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

0
F0-nolib/htu21d_nucleo/usart.bin Normal file → Executable file
View File

0
F0-nolib/morze/morze.bin Normal file → Executable file
View File

0
F0-nolib/pl2303/pl2303.bin Normal file → Executable file
View File

0
F0-nolib/tsys01_nucleo/tsys01.bin Normal file → Executable file
View File

0
F0-nolib/uart_blink/uartblink.bin Normal file → Executable file
View File

0
F0-nolib/uart_blink_dma/uartblink.bin Normal file → Executable file
View File

0
F0-nolib/uart_nucleo/usart.bin Normal file → Executable file
View File

View File

@@ -165,7 +165,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/usbcan/usbcan.bin Normal file → Executable file
View File