diff --git a/right/src/buspal/bl_peripheral.h b/right/src/buspal/bl_peripheral.h index e0389c6..c418a5a 100644 --- a/right/src/buspal/bl_peripheral.h +++ b/right/src/buspal/bl_peripheral.h @@ -34,7 +34,6 @@ typedef void (*serial_byte_receive_func_t)(uint8_t); //! @brief Peripheral control interface. typedef struct _peripheral_control_interface { - bool (*pollForActivity)(const peripheral_descriptor_t *self); status_t (*init)(const peripheral_descriptor_t *self, serial_byte_receive_func_t function); void (*shutdown)(const peripheral_descriptor_t *self); void (*pump)(const peripheral_descriptor_t *self); diff --git a/right/src/buspal/bm_usb/hid_bootloader.c b/right/src/buspal/bm_usb/hid_bootloader.c index d994916..ac5f722 100644 --- a/right/src/buspal/bm_usb/hid_bootloader.c +++ b/right/src/buspal/bm_usb/hid_bootloader.c @@ -1,5 +1,6 @@ #include "usb_descriptor.h" #include "composite.h" +#include "peripherials/test_led.h" extern usb_device_endpoint_struct_t g_hid_generic_endpoints[]; static usb_device_composite_struct_t *g_device_composite; @@ -40,7 +41,7 @@ usb_status_t usb_device_hid_generic_callback(class_handle_t handle, uint32_t eve g_device_composite->hid_generic.hid_packet.reportSize = hid_report_param->reportLength; g_device_composite->hid_generic.hid_packet.didReceiveFirstReport = true; - +TEST_LED_OFF(); // Wake up the read packet handler. sync_signal(&g_device_composite->hid_generic.hid_packet.receiveSync); error = kStatus_USB_Success; diff --git a/right/src/buspal/bus_pal_hardware.c b/right/src/buspal/bus_pal_hardware.c index a498ae5..ba78ccd 100644 --- a/right/src/buspal/bus_pal_hardware.c +++ b/right/src/buspal/bus_pal_hardware.c @@ -19,8 +19,7 @@ static void init_i2c(uint32_t instance); static bool s_dHidActivity = false; -const peripheral_control_interface_t g_usbHidControlInterface = {.pollForActivity = usb_hid_poll_for_activity, - .init = usb_device_full_init, +const peripheral_control_interface_t g_usbHidControlInterface = {.init = usb_device_full_init, .shutdown = usb_device_full_shutdown, .pump = usb_msc_pump }; @@ -75,8 +74,7 @@ bool usb_clock_init(void) bool usb_hid_poll_for_activity(const peripheral_descriptor_t *self) { - s_dHidActivity = g_device_composite.hid_generic.hid_packet.didReceiveFirstReport; - return g_device_composite.attach && s_dHidActivity; + return g_device_composite.attach && g_device_composite.hid_generic.hid_packet.didReceiveFirstReport; } usb_status_t usb_device_callback(usb_device_handle handle, uint32_t event, void *param) @@ -242,7 +240,6 @@ void usb_device_full_shutdown(const peripheral_descriptor_t *self) void usb_msc_pump(const peripheral_descriptor_t *self) { s_dHidActivity = true; - TEST_LED_OFF(); } status_t usb_hid_packet_init(const peripheral_descriptor_t *self) diff --git a/right/src/buspal/command.c b/right/src/buspal/command.c index e9eed6c..d732bac 100644 --- a/right/src/buspal/command.c +++ b/right/src/buspal/command.c @@ -34,7 +34,6 @@ void handleUsbBusPalCommand() static void handle_config_i2c(uint8_t *packet, uint32_t packetLength) { -// TEST_LED_OFF(); configure_i2c_packet_t *command = (configure_i2c_packet_t *)packet; configure_i2c_address(command->address); configure_i2c_speed(command->speed); @@ -394,7 +393,6 @@ status_t bootloader_command_pump() debug_printf("Error: readPacket returned status 0x%x\r\n", status); break; } -// TEST_LED_OFF(); if (g_commandData.packetLength == 0) {