aboutsummaryrefslogtreecommitdiffstats
path: root/lib/pjrc_usb_serial/usb_serial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-08-07 11:33:31 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-08-08 00:27:28 -0400
commita9982beacf184ccdc4bf1221852c900b0809537d (patch)
tree0c7774106b678688361ae8b4ffc346eb51b7b013 /lib/pjrc_usb_serial/usb_serial.c
parente9d2ec7c41c60ab74fe2850fb0787af7bb3361f4 (diff)
downloadkutter-a9982beacf184ccdc4bf1221852c900b0809537d.tar.gz
kutter-a9982beacf184ccdc4bf1221852c900b0809537d.tar.xz
kutter-a9982beacf184ccdc4bf1221852c900b0809537d.zip
sched: Introduce sched_wake_tasks() function to wake up tasks
Add function to indicate when tasks need to be run. This will allow the scheduler code to know if there are any tasks that need to be processed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'lib/pjrc_usb_serial/usb_serial.c')
-rw-r--r--lib/pjrc_usb_serial/usb_serial.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/pjrc_usb_serial/usb_serial.c b/lib/pjrc_usb_serial/usb_serial.c
index ac5bc8a2..0c2488d5 100644
--- a/lib/pjrc_usb_serial/usb_serial.c
+++ b/lib/pjrc_usb_serial/usb_serial.c
@@ -325,7 +325,7 @@ void usb_init(void)
UDCON = 0; // enable attach resistor
usb_configuration = 0;
cdc_line_rtsdtr = 0;
- UDIEN = (1<<EORSTE)|(1<<SOFE);
+ UDIEN = (1<<EORSTE);
sei();
}
@@ -359,6 +359,7 @@ int16_t usb_serial_getchar(void)
UEINTX = 0x6B;
goto retry;
}
+ UEIENX = (1<<RXOUTE);
SREG = intr_state;
return -1;
}
@@ -775,7 +776,14 @@ static inline void usb_ack_out(void)
//
ISR(USB_COM_vect)
{
- uint8_t intbits;
+ uint8_t intbits = UEINT;
+ if (intbits & (1<<CDC_RX_ENDPOINT)) {
+ UENUM = CDC_RX_ENDPOINT;
+ UEIENX = 0;
+ extern void sched_wake_tasks(void);
+ sched_wake_tasks();
+ return;
+ }
const uint8_t *list;
const uint8_t *cfg;
uint8_t i, n, len, en;