mirror of
https://github.com/eddyem/stm32samples.git
synced 2025-12-06 18:55:13 +03:00
Fixed bug in can.s: CAN->BTR |= -->> CAN->BTR =
This commit is contained in:
parent
31aaaeccf6
commit
e9b497f827
@ -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
0
F0-nolib/CANbus_stepper/src/canstepper.bin
Normal file → Executable file
0
F0-nolib/Chiller/chiller.bin
Normal file → Executable file
0
F0-nolib/Chiller/chiller.bin
Normal file → Executable file
0
F0-nolib/F0_testbrd/pl2303.bin
Normal file → Executable file
0
F0-nolib/F0_testbrd/pl2303.bin
Normal file → Executable file
0
F0-nolib/QuadEncoder/encoder.bin
Normal file → Executable file
0
F0-nolib/QuadEncoder/encoder.bin
Normal file → Executable file
0
F0-nolib/Servo/servo.bin
Normal file → Executable file
0
F0-nolib/Servo/servo.bin
Normal file → Executable file
0
F0-nolib/TM1637/tm1637.bin
Normal file → Executable file
0
F0-nolib/TM1637/tm1637.bin
Normal file → Executable file
0
F0-nolib/USBHID/usbhid.bin
Normal file → Executable file
0
F0-nolib/USBHID/usbhid.bin
Normal file → Executable file
0
F0-nolib/blink/blink.bin
Normal file → Executable file
0
F0-nolib/blink/blink.bin
Normal file → Executable 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
0
F0-nolib/canbus/src/canbus.bin
Normal file → Executable file
0
F0-nolib/htu21d_nucleo/usart.bin
Normal file → Executable file
0
F0-nolib/htu21d_nucleo/usart.bin
Normal file → Executable file
0
F0-nolib/morze/morze.bin
Normal file → Executable file
0
F0-nolib/morze/morze.bin
Normal file → Executable file
0
F0-nolib/pl2303/pl2303.bin
Normal file → Executable file
0
F0-nolib/pl2303/pl2303.bin
Normal file → Executable file
0
F0-nolib/tsys01_nucleo/tsys01.bin
Normal file → Executable file
0
F0-nolib/tsys01_nucleo/tsys01.bin
Normal file → Executable file
0
F0-nolib/uart_blink/uartblink.bin
Normal file → Executable file
0
F0-nolib/uart_blink/uartblink.bin
Normal file → Executable file
0
F0-nolib/uart_blink_dma/uartblink.bin
Normal file → Executable file
0
F0-nolib/uart_blink_dma/uartblink.bin
Normal file → Executable file
0
F0-nolib/uart_nucleo/usart.bin
Normal file → Executable file
0
F0-nolib/uart_nucleo/usart.bin
Normal file → Executable 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
0
F0-nolib/usbcan/usbcan.bin
Normal file → Executable file
0
F0/blink/blink.bin
Normal file → Executable file
0
F0/blink/blink.bin
Normal file → Executable file
0
F0/uart/uart.bin
Normal file → Executable file
0
F0/uart/uart.bin
Normal file → Executable file
0
F1-nolib/CDC_ACM/cdcacm.bin
Normal file → Executable file
0
F1-nolib/CDC_ACM/cdcacm.bin
Normal file → Executable file
0
F1-nolib/F1_testbrd/pl2303.bin
Normal file → Executable file
0
F1-nolib/F1_testbrd/pl2303.bin
Normal file → Executable file
0
F1-nolib/LED_Screen/LEDscreen.bin
Normal file → Executable file
0
F1-nolib/LED_Screen/LEDscreen.bin
Normal file → Executable file
0
F1-nolib/LED_Screen/genlist
Normal file → Executable file
0
F1-nolib/LED_Screen/genlist
Normal file → Executable file
0
F1-nolib/LED_Screen/scrtest/scrtest
Normal file → Executable file
0
F1-nolib/LED_Screen/scrtest/scrtest
Normal file → Executable file
0
F1-nolib/PL2303/pl2303.bin
Normal file → Executable file
0
F1-nolib/PL2303/pl2303.bin
Normal file → Executable file
0
F1-nolib/SPI/SPI.bin
Normal file → Executable file
0
F1-nolib/SPI/SPI.bin
Normal file → Executable file
0
F1-nolib/USB_HID/usbhid103.bin
Normal file → Executable file
0
F1-nolib/USB_HID/usbhid103.bin
Normal file → Executable file
0
F1-nolib/chronometer/chrono.bin
Executable file → Normal file
0
F1-nolib/chronometer/chrono.bin
Executable file → Normal file
0
F1-nolib/chronometer_v2/chrono.bin
Normal file → Executable file
0
F1-nolib/chronometer_v2/chrono.bin
Normal file → Executable file
0
F1-nolib/led_blink/blink.bin
Normal file → Executable file
0
F1-nolib/led_blink/blink.bin
Normal file → Executable file
0
F1-nolib/uart/uart.bin
Normal file → Executable file
0
F1-nolib/uart/uart.bin
Normal file → Executable file
0
F1/1_wire/onewire.bin
Normal file → Executable file
0
F1/1_wire/onewire.bin
Normal file → Executable file
0
F1/2.8TFT/dma_gpio.bin
Normal file → Executable file
0
F1/2.8TFT/dma_gpio.bin
Normal file → Executable file
0
F1/DMA_GPIO/dma_gpio.bin
Normal file → Executable file
0
F1/DMA_GPIO/dma_gpio.bin
Normal file → Executable file
0
F1/GPIO_TIM/tim_gpio.bin
Normal file → Executable file
0
F1/GPIO_TIM/tim_gpio.bin
Normal file → Executable file
0
F1/GPS+ultrasonic/timelapse.bin
Normal file → Executable file
0
F1/GPS+ultrasonic/timelapse.bin
Normal file → Executable file
0
F1/GPS/GPS.bin
Normal file → Executable file
0
F1/GPS/GPS.bin
Normal file → Executable file
0
F1/Jeep_generator/jeep_generator.bin
Normal file → Executable file
0
F1/Jeep_generator/jeep_generator.bin
Normal file → Executable file
0
F1/Timelapse_keyboard/timelapse.bin
Normal file → Executable file
0
F1/Timelapse_keyboard/timelapse.bin
Normal file → Executable file
0
F1/Timelapse_keyboard_only_lasers/timelapse.bin
Normal file → Executable file
0
F1/Timelapse_keyboard_only_lasers/timelapse.bin
Normal file → Executable file
0
F1/USBCDC_template/usb_cdc_simple.bin
Normal file → Executable file
0
F1/USBCDC_template/usb_cdc_simple.bin
Normal file → Executable file
0
F1/canon_lens/canon_lens.bin
Normal file → Executable file
0
F1/canon_lens/canon_lens.bin
Normal file → Executable file
0
F1/distance_meters/ultrasonic.bin
Normal file → Executable file
0
F1/distance_meters/ultrasonic.bin
Normal file → Executable file
0
F1/hid_mouse_keyboard/usbhid.bin
Normal file → Executable file
0
F1/hid_mouse_keyboard/usbhid.bin
Normal file → Executable file
0
F1/keyboard_snippet/keyboard.bin
Normal file → Executable file
0
F1/keyboard_snippet/keyboard.bin
Normal file → Executable file
0
F1/matrix_keyboard/matrkeyb.bin
Normal file → Executable file
0
F1/matrix_keyboard/matrkeyb.bin
Normal file → Executable file
0
F1/nokia5110/nokia5110.bin
Normal file → Executable file
0
F1/nokia5110/nokia5110.bin
Normal file → Executable file
0
F1/simple_cdc/usb_cdc_simple.bin
Normal file → Executable file
0
F1/simple_cdc/usb_cdc_simple.bin
Normal file → Executable file
0
F1/stepper_motion/usb_cdc_simple.bin
Normal file → Executable file
0
F1/stepper_motion/usb_cdc_simple.bin
Normal file → Executable file
0
F1/ultrasonic/ultrasonic.bin
Normal file → Executable file
0
F1/ultrasonic/ultrasonic.bin
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user