Remove LED jumper and ISO jumper related code, as the presence of LEDs and ISO/ANSI configuration will be stored in the hardware configuration area of the EEPROM instead of using solder jumpers.
This commit is contained in:
1
left/build/kds/.gitignore
vendored
1
left/build/kds/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
/debug/
|
||||
/release/
|
||||
/v7-release/
|
||||
/v6-release/
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#include "main.h"
|
||||
#include "i2c_addresses.h"
|
||||
#include "i2c.h"
|
||||
#include "iso_jumper.h"
|
||||
|
||||
void SetError(uint8_t error);
|
||||
void SetGenericError();
|
||||
@@ -37,8 +36,5 @@ void BridgeProtocolHandler()
|
||||
BridgeTxSize = 0;
|
||||
TEST_LED_SET(BridgeRxBuffer[1]);
|
||||
break;
|
||||
case BRIDGE_COMMAND_GET_ISO_JUMPER_STATE:
|
||||
BridgeTxBuffer[0] = IsoJumperState;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
#define BRIDGE_COMMAND_GET_KEY_STATES 0
|
||||
#define BRIDGE_COMMAND_SET_LED 1
|
||||
#define BRIDGE_COMMAND_GET_ISO_JUMPER_STATE 2
|
||||
|
||||
// Variables:
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include "fsl_i2c.h"
|
||||
#include "fsl_clock.h"
|
||||
#include "i2c.h"
|
||||
#include "iso_jumper.h"
|
||||
|
||||
void InitI2c() {
|
||||
port_pin_config_t pinConfig = {
|
||||
@@ -42,6 +41,5 @@ void InitPeripherials(void)
|
||||
{
|
||||
InitLedDriver();
|
||||
InitTestLed();
|
||||
InitIsoJumper();
|
||||
InitI2c();
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#include "iso_jumper.h"
|
||||
#include "fsl_port.h"
|
||||
|
||||
void InitIsoJumper() {
|
||||
CLOCK_EnableClock(ISO_JUMPER_INPUT_CLOCK);
|
||||
PORT_SetPinConfig(ISO_JUMPER_INPUT_PORT, ISO_JUMPER_INPUT_PIN,
|
||||
&(port_pin_config_t){.pullSelect=kPORT_PullDown, .mux=kPORT_MuxAsGpio});
|
||||
GPIO_PinInit(ISO_JUMPER_INPUT_GPIO, ISO_JUMPER_INPUT_PIN, &(gpio_pin_config_t){kGPIO_DigitalInput});
|
||||
|
||||
CLOCK_EnableClock(ISO_JUMPER_OUTPUT_CLOCK);
|
||||
PORT_SetPinConfig(ISO_JUMPER_OUTPUT_PORT, ISO_JUMPER_OUTPUT_PIN,
|
||||
&(port_pin_config_t){.pullSelect=kPORT_PullDisable, .mux=kPORT_MuxAsGpio});
|
||||
GPIO_PinInit(ISO_JUMPER_OUTPUT_GPIO, ISO_JUMPER_OUTPUT_PIN, &(gpio_pin_config_t){kGPIO_DigitalOutput, 1});
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
#ifndef __ISO_JUMPER_H__
|
||||
#define __ISO_JUMPER_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "fsl_gpio.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define ISO_JUMPER_INPUT_GPIO GPIOB
|
||||
#define ISO_JUMPER_INPUT_PORT PORTB
|
||||
#define ISO_JUMPER_INPUT_CLOCK kCLOCK_PortB
|
||||
#define ISO_JUMPER_INPUT_PIN 13
|
||||
#define ISO_JUMPER_INPUT_IRQ PORTB_IRQn
|
||||
#define ISO_JUMPER_INPUT_IRQ_HANDLER PORTB_IRQHandler
|
||||
|
||||
#define ISO_JUMPER_OUTPUT_GPIO GPIOA
|
||||
#define ISO_JUMPER_OUTPUT_PORT PORTA
|
||||
#define ISO_JUMPER_OUTPUT_CLOCK kCLOCK_PortA
|
||||
#define ISO_JUMPER_OUTPUT_PIN 6
|
||||
#define ISO_JUMPER_OUTPUT_IRQ PORTA_IRQn
|
||||
#define ISO_JUMPER_OUTPUT_IRQ_HANDLER PORTA_IRQHandler
|
||||
|
||||
#define ISO_JUMPER_IS_ENABLED !GPIO_ReadPinInput(ISO_JUMPER_INPUT_GPIO, ISO_JUMPER_INPUT_PIN)
|
||||
|
||||
// Functions:
|
||||
|
||||
extern void InitIsoJumper();
|
||||
|
||||
#endif
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "i2c.h"
|
||||
#include "init_peripherials.h"
|
||||
#include "bridge_protocol_handler.h"
|
||||
#include "iso_jumper.h"
|
||||
|
||||
key_matrix_t keyMatrix = {
|
||||
.colNum = KEYBOARD_MATRIX_COLS_NUM,
|
||||
@@ -84,7 +83,6 @@ int main(void)
|
||||
{
|
||||
InitClock();
|
||||
InitPeripherials();
|
||||
IsoJumperState = ISO_JUMPER_IS_ENABLED;
|
||||
|
||||
I2C_SlaveGetDefaultConfig(&slaveConfig);
|
||||
slaveConfig.slaveAddress = I2C_ADDRESS_LEFT_KEYBOARD_HALF;
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "i2c.h"
|
||||
#include "led_driver.h"
|
||||
#include "merge_sensor.h"
|
||||
#include "led_jumper.h"
|
||||
|
||||
void InitI2c() {
|
||||
port_pin_config_t pinConfig = {
|
||||
@@ -47,7 +46,6 @@ void InitI2c() {
|
||||
void InitPeripherials(void)
|
||||
{
|
||||
InitResetButton();
|
||||
InitLedJumper();
|
||||
InitMergeSensor();
|
||||
InitTestLed();
|
||||
InitI2c();
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
#include "led_jumper.h"
|
||||
#include "fsl_port.h"
|
||||
|
||||
void InitLedJumper() {
|
||||
CLOCK_EnableClock(LED_JUMPER_CLOCK);
|
||||
PORT_SetPinConfig(LED_JUMPER_PORT, LED_JUMPER_PIN,
|
||||
&(port_pin_config_t){.pullSelect=kPORT_PullUp, .mux=kPORT_MuxAsGpio});
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef __LED_JUMPER_H__
|
||||
#define __LED_JUMPER_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "fsl_gpio.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define LED_JUMPER_GPIO GPIOC
|
||||
#define LED_JUMPER_PORT PORTC
|
||||
#define LED_JUMPER_CLOCK kCLOCK_PortC
|
||||
#define LED_JUMPER_PIN 4
|
||||
#define LED_JUMPER_IRQ PORTC_IRQn
|
||||
#define LED_JUMPER_IRQ_HANDLER PORTC_IRQHandler
|
||||
|
||||
#define LED_JUMPER_IS_ENABLED !GPIO_ReadPinInput(LED_JUMPER_GPIO, LED_JUMPER_PIN)
|
||||
|
||||
// Functions:
|
||||
|
||||
extern void InitLedJumper();
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "i2c_addresses.h"
|
||||
#include "led_driver.h"
|
||||
#include "merge_sensor.h"
|
||||
#include "led_jumper.h"
|
||||
|
||||
void SetError(uint8_t error);
|
||||
void SetGenericError();
|
||||
@@ -17,8 +16,6 @@ void ReadLedDriver();
|
||||
void WriteEeprom();
|
||||
void ReadEeprom();
|
||||
void ReadMergeSensor();
|
||||
void ReadLedJumper();
|
||||
void ReadIsoJumper();
|
||||
|
||||
// Functions for setting error statuses
|
||||
|
||||
@@ -68,12 +65,6 @@ void UsbProtocolHandler()
|
||||
case USB_COMMAND_READ_MERGE_SENSOR:
|
||||
ReadMergeSensor();
|
||||
break;
|
||||
case USB_COMMAND_READ_LED_JUMPER:
|
||||
ReadLedJumper();
|
||||
break;
|
||||
case USB_COMMAND_READ_ISO_JUMPER:
|
||||
ReadIsoJumper();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -180,19 +171,3 @@ void ReadMergeSensor()
|
||||
{
|
||||
SetResponseByte(MERGE_SENSOR_IS_MERGED);
|
||||
}
|
||||
|
||||
void ReadLedJumper()
|
||||
{
|
||||
SetResponseByte(LED_JUMPER_IS_ENABLED);
|
||||
}
|
||||
|
||||
void ReadIsoJumper()
|
||||
{
|
||||
uint8_t txBuffer[] = {2};
|
||||
I2cWrite(I2C_MAIN_BUS_BASEADDR, I2C_ADDRESS_LEFT_KEYBOARD_HALF, txBuffer, sizeof(txBuffer));
|
||||
|
||||
uint8_t rxBuffer[1];
|
||||
I2cRead(I2C_MAIN_BUS_BASEADDR, I2C_ADDRESS_LEFT_KEYBOARD_HALF, rxBuffer, sizeof(rxBuffer));
|
||||
|
||||
SetResponseByte(rxBuffer[0]);
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@
|
||||
#define WRITE_EEPROM_RESPONSE_INVALID_PAYLOAD_SIZE 1
|
||||
#define USB_COMMAND_READ_EEPROM 6
|
||||
#define USB_COMMAND_READ_MERGE_SENSOR 7
|
||||
#define USB_COMMAND_READ_LED_JUMPER 8
|
||||
#define USB_COMMAND_READ_ISO_JUMPER 9
|
||||
|
||||
// Functions:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user