Skip to content

Commit

Permalink
FIX: switch to USB polling
Browse files Browse the repository at this point in the history
  • Loading branch information
r2axz committed Nov 29, 2020
1 parent e64fb21 commit 1b7a6b0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ int main() {
status_led_init();
usb_init();
while (1) {
__NOP();
usb_poll();
}
}
1 change: 1 addition & 0 deletions usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
#define USB_H

void usb_init();
void usb_poll();

#endif /* USB_H */
5 changes: 1 addition & 4 deletions usb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ void usb_io_init() {
USB->DADDR = 0;
USB->ISTR = 0;
USB->CNTR = USB_CNTR_RESETM;
NVIC_SetPriority(USB_LP_CAN1_RX0_IRQn, SYSTEM_INTERRUTPS_PRIORITY_BASE);
NVIC_EnableIRQ(USB_LP_CAN1_RX0_IRQn);
}

/* Get Number of RX/TX Bytes Available */
Expand Down Expand Up @@ -211,8 +209,7 @@ static uint8_t usb_transfer_led_timer = 0;

uint16_t istr;

void USB_LP_CAN1_RX0_IRQHandler() {
(void)USB_LP_CAN1_RX0_IRQHandler;
void usb_poll() {
istr = USB->ISTR;
if (istr & USB_ISTR_CTR) {
uint8_t ep_num = USB->ISTR & USB_ISTR_EP_ID;
Expand Down
1 change: 1 addition & 0 deletions usb_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <stddef.h>
#include <stm32f1xx.h>
#include "circ_buf.h"
#include "usb.h"
#include "usb_std.h"
#include "usb_core.h"

Expand Down

0 comments on commit 1b7a6b0

Please sign in to comment.