Move UsbDebugInfo into usb_command_get_debug_info.[ch] and remove external UsbDebugInfo references.
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
#include "fsl_pit.h"
|
#include "fsl_pit.h"
|
||||||
#include "key_scanner.h"
|
#include "key_scanner.h"
|
||||||
#include "usb_protocol_handler.h"
|
|
||||||
|
|
||||||
uint32_t counter = 0;
|
uint32_t counter = 0;
|
||||||
|
|
||||||
void PIT_KEY_SCANNER_HANDLER(void)
|
void PIT_KEY_SCANNER_HANDLER(void)
|
||||||
{
|
{
|
||||||
*((uint32_t*)(UsbDebugInfo+20)) = counter++;
|
|
||||||
KeyMatrix_ScanRow(&RightKeyMatrix);
|
KeyMatrix_ScanRow(&RightKeyMatrix);
|
||||||
PIT_ClearStatusFlags(PIT, PIT_KEY_SCANNER_CHANNEL, PIT_TFLG_TIF_MASK);
|
PIT_ClearStatusFlags(PIT, PIT_KEY_SCANNER_CHANNEL, PIT_TFLG_TIF_MASK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include "slave_scheduler.h"
|
#include "slave_scheduler.h"
|
||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
|
|
||||||
|
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||||
|
|
||||||
void UsbCommand_GetDebugInfo(void)
|
void UsbCommand_GetDebugInfo(void)
|
||||||
{
|
{
|
||||||
*(uint32_t*)(UsbDebugInfo+1) = I2C_Watchdog;
|
*(uint32_t*)(UsbDebugInfo+1) = I2C_Watchdog;
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
#ifndef __USB_COMMAND_GET_DEBUG_INFO_H__
|
#ifndef __USB_COMMAND_GET_DEBUG_INFO_H__
|
||||||
#define __USB_COMMAND_GET_DEBUG_INFO_H__
|
#define __USB_COMMAND_GET_DEBUG_INFO_H__
|
||||||
|
|
||||||
|
// Includes:
|
||||||
|
|
||||||
|
#include "usb_interfaces/usb_interface_generic_hid.h"
|
||||||
|
|
||||||
|
// Variables:
|
||||||
|
|
||||||
|
extern uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
||||||
|
|
||||||
// Functions:
|
// Functions:
|
||||||
|
|
||||||
void UsbCommand_GetDebugInfo(void);
|
void UsbCommand_GetDebugInfo(void);
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
#include "peripherals/reset_button.h"
|
#include "peripherals/reset_button.h"
|
||||||
#include "key_action.h"
|
#include "key_action.h"
|
||||||
#include "usb_protocol_handler.h"
|
|
||||||
|
|
||||||
static usb_device_endpoint_struct_t UsbMouseEndpoints[USB_MOUSE_ENDPOINT_COUNT] = {{
|
static usb_device_endpoint_struct_t UsbMouseEndpoints[USB_MOUSE_ENDPOINT_COUNT] = {{
|
||||||
USB_MOUSE_ENDPOINT_INDEX | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
|
USB_MOUSE_ENDPOINT_INDEX | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
|
||||||
@@ -60,8 +59,6 @@ void ResetActiveUsbMouseReport(void)
|
|||||||
static volatile usb_status_t usbMouseAction(void)
|
static volatile usb_status_t usbMouseAction(void)
|
||||||
{
|
{
|
||||||
usb_mouse_report_t *mouseReport = getInactiveUsbMouseReport();
|
usb_mouse_report_t *mouseReport = getInactiveUsbMouseReport();
|
||||||
*((uint16_t*)(UsbDebugInfo+16)) = mouseReport->x;
|
|
||||||
*((uint16_t*)(UsbDebugInfo+18)) = mouseReport->y;
|
|
||||||
IsUsbMouseReportSent = true;
|
IsUsbMouseReportSent = true;
|
||||||
return USB_DeviceHidSend(UsbCompositeDevice.mouseHandle, USB_MOUSE_ENDPOINT_INDEX,
|
return USB_DeviceHidSend(UsbCompositeDevice.mouseHandle, USB_MOUSE_ENDPOINT_INDEX,
|
||||||
(uint8_t*)mouseReport, USB_MOUSE_REPORT_LENGTH);
|
(uint8_t*)mouseReport, USB_MOUSE_REPORT_LENGTH);
|
||||||
|
|||||||
@@ -13,8 +13,6 @@
|
|||||||
#include "usb_commands/usb_command_jump_to_slave_bootloader.h"
|
#include "usb_commands/usb_command_jump_to_slave_bootloader.h"
|
||||||
#include "usb_commands/usb_command_send_kboot_command.h"
|
#include "usb_commands/usb_command_send_kboot_command.h"
|
||||||
|
|
||||||
uint8_t UsbDebugInfo[USB_GENERIC_HID_OUT_BUFFER_LENGTH];
|
|
||||||
|
|
||||||
void SetUsbError(uint8_t error)
|
void SetUsbError(uint8_t error)
|
||||||
{
|
{
|
||||||
GenericHidOutBuffer[0] = error;
|
GenericHidOutBuffer[0] = error;
|
||||||
|
|||||||
@@ -40,10 +40,6 @@
|
|||||||
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