Rename the test mode for clarity

This commit is contained in:
Eric Tang
2018-07-20 17:31:00 -07:00
parent a2866feb77
commit c3a5d258e5
5 changed files with 79 additions and 79 deletions

View File

@@ -1,9 +1,9 @@
#include "test_mode.h" #include "test_switches.h"
#include "led_display.h" #include "led_display.h"
#include "key_action.h" #include "key_action.h"
#include "keymap.h" #include "keymap.h"
bool TestModeActive = false; bool TestSwitches = false;
static const key_action_t TestKeymap[1][2][MAX_KEY_COUNT_PER_MODULE] = { static const key_action_t TestKeymap[1][2][MAX_KEY_COUNT_PER_MODULE] = {
// Base layer // Base layer
@@ -106,7 +106,7 @@ static const key_action_t TestKeymap[1][2][MAX_KEY_COUNT_PER_MODULE] = {
} }
}; };
void TestMode_Activate(void) void TestSwitches_Activate(void)
{ {
memcpy(&CurrentKeymap, &TestKeymap, sizeof TestKeymap); memcpy(&CurrentKeymap, &TestKeymap, sizeof TestKeymap);
LedDisplay_SetText(3, "TES"); LedDisplay_SetText(3, "TES");

View File

@@ -7,10 +7,10 @@
// Functions: // Functions:
void TestMode_Activate(void); void TestSwitches_Activate(void);
// Variables: // Variables:
extern bool TestModeActive; extern bool TestSwitches;
#endif #endif

View File

@@ -1,7 +1,7 @@
#include "usb_protocol_handler.h" #include "usb_protocol_handler.h"
#include "usb_commands/usb_command_get_variable.h" #include "usb_commands/usb_command_get_variable.h"
#include "key_matrix.h" #include "key_matrix.h"
#include "test_mode.h" #include "test_switches.h"
#include "usb_report_updater.h" #include "usb_report_updater.h"
void UsbCommand_GetVariable(void) void UsbCommand_GetVariable(void)
@@ -9,8 +9,8 @@ void UsbCommand_GetVariable(void)
usb_variable_id_t variableId = GetUsbRxBufferUint8(1); usb_variable_id_t variableId = GetUsbRxBufferUint8(1);
switch (variableId) { switch (variableId) {
case UsbVariable_TestModeActive: case UsbVariable_TestSwitches:
SetUsbTxBufferUint8(1, TestModeActive); SetUsbTxBufferUint8(1, TestSwitches);
break; break;
case UsbVariable_TestUsbStack: case UsbVariable_TestUsbStack:
SetUsbTxBufferUint8(1, TestUsbStack); SetUsbTxBufferUint8(1, TestUsbStack);

View File

@@ -1,7 +1,7 @@
#include "usb_protocol_handler.h" #include "usb_protocol_handler.h"
#include "usb_commands/usb_command_set_variable.h" #include "usb_commands/usb_command_set_variable.h"
#include "key_matrix.h" #include "key_matrix.h"
#include "test_mode.h" #include "test_switches.h"
#include "usb_report_updater.h" #include "usb_report_updater.h"
void UsbCommand_SetVariable(void) void UsbCommand_SetVariable(void)
@@ -9,10 +9,10 @@ void UsbCommand_SetVariable(void)
usb_variable_id_t variableId = GetUsbRxBufferUint8(1); usb_variable_id_t variableId = GetUsbRxBufferUint8(1);
switch (variableId) { switch (variableId) {
case UsbVariable_TestModeActive: case UsbVariable_TestSwitches:
if (GetUsbRxBufferUint8(2)) { if (GetUsbRxBufferUint8(2)) {
TestModeActive = true; TestSwitches = true;
TestMode_Activate(); TestSwitches_Activate();
} }
break; break;
case UsbVariable_TestUsbStack: case UsbVariable_TestUsbStack:

View File

@@ -39,7 +39,7 @@
} usb_command_id_t; } usb_command_id_t;
typedef enum { typedef enum {
UsbVariable_TestModeActive, UsbVariable_TestSwitches,
UsbVariable_TestUsbStack, UsbVariable_TestUsbStack,
UsbVariable_DebounceTimePress, UsbVariable_DebounceTimePress,
UsbVariable_DebounceTimeRelease UsbVariable_DebounceTimeRelease