Don't include the debug over SPI code from any file.
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
#ifndef __CONFIG_H__
|
#ifndef __CONFIG_H__
|
||||||
#define __CONFIG_H__
|
#define __CONFIG_H__
|
||||||
|
|
||||||
// Macros:
|
|
||||||
|
|
||||||
// #define DEBUG_OVER_SPI
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
|
|
||||||
#include "debug_over_spi.h"
|
#include "debug_over_spi.h"
|
||||||
#include "config.h"
|
|
||||||
#include "fsl_gpio.h"
|
#include "fsl_gpio.h"
|
||||||
|
|
||||||
|
|
||||||
#define EXAMPLE_SPI_MASTER (SPI0)
|
#define EXAMPLE_SPI_MASTER (SPI0)
|
||||||
#define EXAMPLE_SPI_MASTER_SOURCE_CLOCK (kCLOCK_BusClk)
|
#define EXAMPLE_SPI_MASTER_SOURCE_CLOCK (kCLOCK_BusClk)
|
||||||
|
|
||||||
@@ -52,5 +48,3 @@ void DebugOverSpi_Send(uint8_t *tx, uint8_t len)
|
|||||||
SPI_MasterTransferNonBlocking(EXAMPLE_SPI_MASTER, &handle, &xfer);
|
SPI_MasterTransferNonBlocking(EXAMPLE_SPI_MASTER, &handle, &xfer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
|
|
||||||
#ifndef __DEBUG_OVER_SPI_H__
|
#ifndef __DEBUG_OVER_SPI_H__
|
||||||
#define __DEBUG_OVER_SPI_H__
|
#define __DEBUG_OVER_SPI_H__
|
||||||
|
|
||||||
@@ -27,8 +25,3 @@
|
|||||||
void DebugOverSpi_Send(uint8_t *tx, uint8_t len);
|
void DebugOverSpi_Send(uint8_t *tx, uint8_t len);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
|
||||||
#define DebugOverSpi_Init()
|
|
||||||
#define DebugOverSpi_Send(tx, len)
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#include "led_pwm.h"
|
#include "led_pwm.h"
|
||||||
#include "slave_protocol_handler.h"
|
#include "slave_protocol_handler.h"
|
||||||
#include "i2c_watchdog.h"
|
#include "i2c_watchdog.h"
|
||||||
#include "debug_over_spi.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
i2c_slave_config_t slaveConfig;
|
i2c_slave_config_t slaveConfig;
|
||||||
@@ -23,7 +22,6 @@ static void i2cSlaveCallback(I2C_Type *base, i2c_slave_transfer_t *xfer, void *u
|
|||||||
{
|
{
|
||||||
dosBuffer[0] = xfer->event;
|
dosBuffer[0] = xfer->event;
|
||||||
dosBuffer[1] = userData;
|
dosBuffer[1] = userData;
|
||||||
DebugOverSpi_Send(dosBuffer, 2);
|
|
||||||
|
|
||||||
switch (xfer->event) {
|
switch (xfer->event) {
|
||||||
case kI2C_SlaveTransmitEvent:
|
case kI2C_SlaveTransmitEvent:
|
||||||
@@ -86,6 +84,5 @@ void InitPeripherals(void)
|
|||||||
InitLedDriver();
|
InitLedDriver();
|
||||||
TestLed_Init();
|
TestLed_Init();
|
||||||
LedPwm_Init();
|
LedPwm_Init();
|
||||||
DebugOverSpi_Init();
|
|
||||||
initI2c();
|
initI2c();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,11 +15,7 @@ key_matrix_t keyMatrix = {
|
|||||||
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
{PORTB, GPIOB, kCLOCK_PortB, 11},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
{PORTA, GPIOA, kCLOCK_PortA, 6},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 8},
|
|
||||||
#else
|
|
||||||
{PORTB, GPIOB, kCLOCK_PortB, 0},
|
{PORTB, GPIOB, kCLOCK_PortB, 0},
|
||||||
#endif
|
|
||||||
{PORTB, GPIOB, kCLOCK_PortB, 6},
|
{PORTB, GPIOB, kCLOCK_PortB, 6},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 3},
|
{PORTA, GPIOA, kCLOCK_PortA, 3},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 12}
|
{PORTA, GPIOA, kCLOCK_PortA, 12}
|
||||||
@@ -28,11 +24,7 @@ key_matrix_t keyMatrix = {
|
|||||||
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
{PORTB, GPIOB, kCLOCK_PortB, 7},
|
||||||
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
{PORTB, GPIOB, kCLOCK_PortB, 10},
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
||||||
#ifdef DEBUG_OVER_SPI
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 5},
|
|
||||||
#else
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 7},
|
{PORTA, GPIOA, kCLOCK_PortA, 7},
|
||||||
#endif
|
|
||||||
{PORTA, GPIOA, kCLOCK_PortA, 4}
|
{PORTA, GPIOA, kCLOCK_PortA, 4}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user