From 5ecd8118f2dc3fd70f98ecf4a294cb7a1703bf8e Mon Sep 17 00:00:00 2001 From: Karolis Stasaitis Date: Sun, 19 Nov 2023 12:55:05 +0100 Subject: [PATCH] back to working state --- src/usb.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/usb.c b/src/usb.c index 4b49088..bedb1c3 100644 --- a/src/usb.c +++ b/src/usb.c @@ -68,8 +68,10 @@ #define STALL_EP0() \ do { IN0_SET_STALL; OUT0_SET_STALL; } while(0) -#define IEP0CNT_CLR { IEP0CNT &= ~0x0f; } -#define IEP0CNT_SET(COUNT) { IEP0CNT_CLR; IEP0CNT |= COUNT; } +#define IEP0CNT_CLR \ + do { IEP0CNT &= ~0x0f; } while(0) +#define IEP0CNT_SET(COUNT) \ + do { IEP0CNT_CLR; IEP0CNT |= COUNT; } while (0) enum { REPORT_ID_ACPI = 0x01, @@ -357,10 +359,10 @@ uint16_t ep0_xfer_bytes_left; uint8_t *ep0_xfer_src; // TODO: remove -uint8_t __xdata usb_rx_data[8]; -uint8_t __xdata *buffer_addr; -__bit device_remote_wakeup_f; -uint8_t __xdata configution_value; +volatile uint8_t __xdata usb_rx_data[8]; +volatile uint8_t __xdata *buffer_addr; +volatile __bit device_remote_wakeup_f; +volatile uint8_t __xdata configution_value; uint8_t __xdata EP1_IDLE_TIME; uint8_t __xdata EP1_IDLE_COUNT; @@ -423,7 +425,7 @@ static void usb_setup_irq() STALL_EP0(); return; } - + break; case (USB_DEVICE_TO_HOST | USB_STANDARD | USB_DEVICE): switch (request) { case USB_GET_STATUS: