Assign the I2C and USB interrupts a lower interrupt priority than the PIT interrupt. This should make the I2C watchdog always recover within the PIT interrupt.
This commit is contained in:
@@ -14,7 +14,15 @@
|
|||||||
#include "eeprom.h"
|
#include "eeprom.h"
|
||||||
#include "microseconds/microseconds_pit.c"
|
#include "microseconds/microseconds_pit.c"
|
||||||
|
|
||||||
void InitI2c() {
|
void InitInterruptPriorities()
|
||||||
|
{
|
||||||
|
NVIC_SetPriority(I2C0_IRQn, 1);
|
||||||
|
NVIC_SetPriority(I2C1_IRQn, 1);
|
||||||
|
NVIC_SetPriority(USB0_IRQn, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitI2c()
|
||||||
|
{
|
||||||
port_pin_config_t pinConfig = {
|
port_pin_config_t pinConfig = {
|
||||||
.pullSelect = kPORT_PullUp,
|
.pullSelect = kPORT_PullUp,
|
||||||
.openDrainEnable = kPORT_OpenDrainEnable
|
.openDrainEnable = kPORT_OpenDrainEnable
|
||||||
@@ -53,6 +61,7 @@ void InitI2c() {
|
|||||||
|
|
||||||
void InitPeripherals(void)
|
void InitPeripherals(void)
|
||||||
{
|
{
|
||||||
|
InitInterruptPriorities();
|
||||||
InitLedDriver();
|
InitLedDriver();
|
||||||
InitResetButton();
|
InitResetButton();
|
||||||
InitMergeSensor();
|
InitMergeSensor();
|
||||||
|
|||||||
Reference in New Issue
Block a user