Add UsbDebugInfo to aid future debugging via USB.
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include "peripherals/test_led.h"
|
#include "peripherals/test_led.h"
|
||||||
#include "usb_interfaces/usb_interface_basic_keyboard.h"
|
#include "usb_interfaces/usb_interface_basic_keyboard.h"
|
||||||
#include "usb_interfaces/usb_interface_media_keyboard.h"
|
#include "usb_interfaces/usb_interface_media_keyboard.h"
|
||||||
|
#include "usb_protocol_handler.h"
|
||||||
#include "bus_pal_hardware.h"
|
#include "bus_pal_hardware.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "bootloader/wormhole.h"
|
#include "bootloader/wormhole.h"
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include "usb_composite_device.h"
|
#include "usb_composite_device.h"
|
||||||
#include "usb_interface_generic_hid.h"
|
#include "usb_interface_generic_hid.h"
|
||||||
|
#include "usb_protocol_handler.h"
|
||||||
|
|
||||||
static usb_device_endpoint_struct_t UsbGenericHidEndpoints[USB_GENERIC_HID_ENDPOINT_COUNT] =
|
static usb_device_endpoint_struct_t UsbGenericHidEndpoints[USB_GENERIC_HID_ENDPOINT_COUNT] =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "usb_api.h"
|
#include "usb_api.h"
|
||||||
#include "usb_descriptors/usb_descriptor_device.h"
|
#include "usb_descriptors/usb_descriptor_device.h"
|
||||||
#include "usb_protocol_handler.h"
|
|
||||||
|
|
||||||
// Macros:
|
// Macros:
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#include "microseconds/microseconds_pit.c"
|
#include "microseconds/microseconds_pit.c"
|
||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
|
|
||||||
|
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||||
|
|
||||||
// Functions for setting error statuses
|
// Functions for setting error statuses
|
||||||
|
|
||||||
void setError(uint8_t error)
|
void setError(uint8_t error)
|
||||||
@@ -233,25 +235,28 @@ void getKeyboardState(void)
|
|||||||
|
|
||||||
void getDebugInfo(void)
|
void getDebugInfo(void)
|
||||||
{
|
{
|
||||||
GenericHidOutBuffer[1] = I2C_Watchdog >> 0;
|
UsbDebugInfo[0] = I2C_Watchdog >> 0;
|
||||||
GenericHidOutBuffer[2] = I2C_Watchdog >> 8;
|
UsbDebugInfo[1] = I2C_Watchdog >> 8;
|
||||||
GenericHidOutBuffer[3] = I2C_Watchdog >> 16;
|
UsbDebugInfo[2] = I2C_Watchdog >> 16;
|
||||||
GenericHidOutBuffer[4] = I2C_Watchdog >> 24;
|
UsbDebugInfo[3] = I2C_Watchdog >> 24;
|
||||||
|
|
||||||
GenericHidOutBuffer[5] = I2cSchedulerCounter >> 0;
|
UsbDebugInfo[4] = I2cSchedulerCounter >> 0;
|
||||||
GenericHidOutBuffer[6] = I2cSchedulerCounter >> 8;
|
UsbDebugInfo[5] = I2cSchedulerCounter >> 8;
|
||||||
GenericHidOutBuffer[7] = I2cSchedulerCounter >> 16;
|
UsbDebugInfo[6] = I2cSchedulerCounter >> 16;
|
||||||
GenericHidOutBuffer[8] = I2cSchedulerCounter >> 24;
|
UsbDebugInfo[7] = I2cSchedulerCounter >> 24;
|
||||||
|
|
||||||
GenericHidOutBuffer[9] = I2cWatchdog_OuterCounter >> 0;
|
UsbDebugInfo[8] = I2cWatchdog_OuterCounter >> 0;
|
||||||
GenericHidOutBuffer[10] = I2cWatchdog_OuterCounter >> 8;
|
UsbDebugInfo[9] = I2cWatchdog_OuterCounter >> 8;
|
||||||
GenericHidOutBuffer[11] = I2cWatchdog_OuterCounter >> 16;
|
UsbDebugInfo[10] = I2cWatchdog_OuterCounter >> 16;
|
||||||
GenericHidOutBuffer[12] = I2cWatchdog_OuterCounter >> 24;
|
UsbDebugInfo[11] = I2cWatchdog_OuterCounter >> 24;
|
||||||
|
|
||||||
|
UsbDebugInfo[12] = I2cWatchdog_InnerCounter >> 0;
|
||||||
|
UsbDebugInfo[13] = I2cWatchdog_InnerCounter >> 8;
|
||||||
|
UsbDebugInfo[14] = I2cWatchdog_InnerCounter >> 16;
|
||||||
|
UsbDebugInfo[15] = I2cWatchdog_InnerCounter >> 24;
|
||||||
|
|
||||||
|
memcpy(GenericHidOutBuffer, UsbDebugInfo, USB_GENERIC_HID_OUT_BUFFER_LENGTH);
|
||||||
|
|
||||||
GenericHidOutBuffer[13] = I2cWatchdog_InnerCounter >> 0;
|
|
||||||
GenericHidOutBuffer[14] = I2cWatchdog_InnerCounter >> 8;
|
|
||||||
GenericHidOutBuffer[15] = I2cWatchdog_InnerCounter >> 16;
|
|
||||||
GenericHidOutBuffer[16] = I2cWatchdog_InnerCounter >> 24;
|
|
||||||
/*
|
/*
|
||||||
uint64_t ticks = microseconds_get_ticks();
|
uint64_t ticks = microseconds_get_ticks();
|
||||||
uint32_t microseconds = microseconds_convert_to_microseconds(ticks);
|
uint32_t microseconds = microseconds_convert_to_microseconds(ticks);
|
||||||
|
|||||||
@@ -41,6 +41,10 @@
|
|||||||
JumpToBootloaderError_InvalidModuleDriverId = 1,
|
JumpToBootloaderError_InvalidModuleDriverId = 1,
|
||||||
} jump_to_bootloader_error_t;
|
} jump_to_bootloader_error_t;
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
void UsbProtocolHandler(void);
|
void UsbProtocolHandler(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user