Skip to content

Commit

Permalink
Increase priority of I2C
Browse files Browse the repository at this point in the history
  • Loading branch information
gerargz authored and gaborcsapo committed Jun 29, 2022
1 parent 46204bf commit e25c017
Show file tree
Hide file tree
Showing 2 changed files with 4 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

0 comments on commit e25c017

Please sign in to comment.