summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa/lufa.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2024-01-09 14:01:34 +0000
committerGitHub <noreply@github.com>2024-01-09 14:01:34 +0000
commitb6b3efc14b21117d13ae33a2eda96c5647817d5b (patch)
treea9c686de2276c3980dec5d8afc499a4ea515da95 /tmk_core/protocol/lufa/lufa.c
parentccec4867c80d25548871e2534d2ca6205891824a (diff)
Remove console out endpoint (#22304)
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
-rw-r--r--tmk_core/protocol/lufa/lufa.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 553f69b1e4..22cc0db8ce 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -184,41 +184,16 @@ static void raw_hid_task(void) {
* Console
******************************************************************************/
#ifdef CONSOLE_ENABLE
-/** \brief Console Task
+/** \brief Console Tasks
*
* FIXME: Needs doc
*/
-static void Console_Task(void) {
+static void console_flush_task(void) {
/* Device must be connected and configured for the task to run */
if (USB_DeviceState != DEVICE_STATE_Configured) return;
uint8_t ep = Endpoint_GetCurrentEndpoint();
-# if 0
- // TODO: impl receivechar()/recvchar()
- Endpoint_SelectEndpoint(CONSOLE_OUT_EPNUM);
-
- /* Check to see if a packet has been sent from the host */
- if (Endpoint_IsOUTReceived())
- {
- /* Check to see if the packet contains data */
- if (Endpoint_IsReadWriteAllowed())
- {
- /* Create a temporary buffer to hold the read in report from the host */
- uint8_t ConsoleData[CONSOLE_EPSIZE];
-
- /* Read Console Report Data */
- Endpoint_Read_Stream_LE(&ConsoleData, sizeof(ConsoleData), NULL);
-
- /* Process Console Report Data */
- //ProcessConsoleHIDReport(ConsoleData);
- }
-
- /* Finalize the stream transfer to send the last packet */
- Endpoint_ClearOUT();
- }
-# endif
-
/* IN packet */
Endpoint_SelectEndpoint(CONSOLE_IN_EPNUM);
if (!Endpoint_IsEnabled() || !Endpoint_IsConfigured()) {
@@ -237,6 +212,10 @@ static void Console_Task(void) {
Endpoint_SelectEndpoint(ep);
}
+
+void console_task(void) {
+ // do nothing
+}
#endif
/*******************************************************************************
@@ -341,7 +320,7 @@ void EVENT_USB_Device_StartOfFrame(void) {
count = 0;
if (!console_flush) return;
- Console_Task();
+ console_flush_task();
console_flush = false;
}
@@ -381,9 +360,6 @@ void EVENT_USB_Device_ConfigurationChanged(void) {
#ifdef CONSOLE_ENABLE
/* Setup console endpoint */
ConfigSuccess &= Endpoint_ConfigureEndpoint((CONSOLE_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, CONSOLE_EPSIZE, 1);
-# if 0
- ConfigSuccess &= Endpoint_ConfigureEndpoint((CONSOLE_OUT_EPNUM | ENDPOINT_DIR_OUT), EP_TYPE_INTERRUPT, CONSOLE_EPSIZE, 1);
-# endif
#endif
#ifdef MIDI_ENABLE
@@ -627,7 +603,7 @@ int8_t sendchar(uint8_t c) {
// The `timed_out` state is an approximation of the ideal `is_listener_disconnected?` state.
static bool timed_out = false;
- // prevents Console_Task() from running during sendchar() runs.
+ // prevents console_flush_task() from running during sendchar() runs.
// or char will be lost. These two function is mutually exclusive.
CONSOLE_FLUSH_SET(false);
@@ -812,7 +788,7 @@ static void setup_usb(void) {
USB_Init();
- // for Console_Task
+ // for console_flush_task
USB_Device_EnableSOFEvents();
}
@@ -876,6 +852,10 @@ void protocol_pre_task(void) {
}
void protocol_post_task(void) {
+#ifdef CONSOLE_ENABLE
+ console_task();
+#endif
+
#ifdef MIDI_ENABLE
MIDI_Device_USBTask(&USB_MIDI_Interface);
#endif