Skip to content

Commit

Permalink
Increase priority of I2C
Browse files Browse the repository at this point in the history
  • Loading branch information
gerargz committed Oct 7, 2020
1 parent f1bb93e commit d94d02f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/board/microbitv2/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ int32_t i2c_initialize(void) {
slaveConfig.enableWakeUp = true;

I2C_SlaveInit(I2C_SLAVE_BASEADDR, &slaveConfig, I2C_SLAVE_CLK_FREQ);

NVIC_SetPriority(I2C1_IRQn, 0x00); /* set highest priority */

i2c_start_transfer();

Expand Down
2 changes: 2 additions & 0 deletions source/board/microbitv2/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ void power_init(void)
/* Enable rising edge interrupt on WAKE_ON_EDGE pin (VBUS falling edge) to detect USB detach */
PORT_SetPinInterruptConfig(PIN_WAKE_ON_EDGE_PORT, PIN_WAKE_ON_EDGE_BIT, kPORT_InterruptRisingEdge);

NVIC_SetPriority(LLWU_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL);
NVIC_EnableIRQ(LLWU_IRQn);
NVIC_SetPriority(PORTC_PORTD_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL);
NVIC_EnableIRQ(PORTC_PORTD_IRQn);
}

Expand Down
2 changes: 2 additions & 0 deletions source/hic_hal/freescale/kl27z/uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ int32_t uart_initialize(void)
UART->CTRL |= LPUART_CTRL_RE_MASK | LPUART_CTRL_TE_MASK;
// Enable receiver interrupt and RX Overrun interrupt
UART->CTRL |= LPUART_CTRL_RIE_MASK | LPUART_CTRL_ORIE_MASK;

NVIC_SetPriority(UART_RX_TX_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL);
NVIC_ClearPendingIRQ(UART_RX_TX_IRQn);
NVIC_EnableIRQ(UART_RX_TX_IRQn);
return 1;
Expand Down
1 change: 1 addition & 0 deletions source/hic_hal/freescale/usbd_kinetis.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ void USBD_Reset(void)
USB0->ERREN = 0xFF; /* enable error interrupt sources */
USB0->ADDR = 0x00; /* set default address */

NVIC_SetPriority(USB0_IRQn, 0x01); /* set second highest priority */
NVIC_EnableIRQ(USB0_IRQn);
}

Expand Down

0 comments on commit d94d02f

Please sign in to comment.