Implement I2C watchdog for the left half. Disable the watchdog because it causes a hard fault. Don't update the test LED inside of SlaveCommand_SetTestLed due to testing purposes until the watchdog issue gets resolved.

This commit is contained in:
László Monda
2017-09-21 23:40:49 +02:00
parent e7330f5d61
commit 8924c36cb3
9 changed files with 81 additions and 6 deletions

View File

@@ -8,6 +8,7 @@
#include "i2c.h"
#include "led_pwm.h"
#include "slave_protocol_handler.h"
#include "i2c_watchdog.h"
static void i2cSlaveCallback(I2C_Type *base, i2c_slave_transfer_t *xfer, void *userData)
{
@@ -34,6 +35,12 @@ static void i2cSlaveCallback(I2C_Type *base, i2c_slave_transfer_t *xfer, void *u
}
}
void InitInterruptPriorities()
{
NVIC_SetPriority(I2C0_IRQn, 1);
NVIC_SetPriority(TPM1_IRQn, 1);
}
void InitI2c(void) {
port_pin_config_t pinConfig = {
.pullSelect = kPORT_PullUp,
@@ -66,8 +73,10 @@ void InitLedDriver(void) {
void InitPeripherals(void)
{
InitInterruptPriorities();
InitLedDriver();
InitTestLed();
LedPwm_Init();
InitI2c();
//InitI2cWatchdog();
}