mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/atxmega: Fix PM states on peripherals
Fix the required PM state on i2c and spi peripherals. Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
This commit is contained in:
parent
3b9368a99e
commit
549e2b4de1
@ -105,7 +105,7 @@ void i2c_acquire(i2c_t i2c)
|
||||
{
|
||||
assert((unsigned)i2c < I2C_NUMOF);
|
||||
DEBUG("acquire\n");
|
||||
pm_block(3);
|
||||
pm_block(4); /* Require clkPer */
|
||||
mutex_lock(&i2c_ctx[i2c].locks);
|
||||
pm_periph_enable(i2c_config[i2c].pwr);
|
||||
|
||||
@ -122,7 +122,7 @@ void i2c_release(i2c_t i2c)
|
||||
dev(i2c)->MASTER.CTRLA = 0;
|
||||
pm_periph_disable(i2c_config[i2c].pwr);
|
||||
mutex_unlock(&i2c_ctx[i2c].locks);
|
||||
pm_unblock(3);
|
||||
pm_unblock(4);
|
||||
DEBUG("release\n");
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ void spi_acquire(spi_t bus, spi_cs_t cs, spi_mode_t mode, spi_clk_t clk)
|
||||
|
||||
DEBUG("acquire\n");
|
||||
|
||||
pm_block(3);
|
||||
pm_block(4); /* Require clkPer */
|
||||
mutex_lock(&locks[bus]);
|
||||
pm_periph_enable(spi_config[bus].pwr);
|
||||
|
||||
@ -113,7 +113,7 @@ void spi_release(spi_t bus)
|
||||
dev(bus)->CTRL &= ~SPI_ENABLE_bm;
|
||||
pm_periph_disable(spi_config[bus].pwr);
|
||||
mutex_unlock(&locks[bus]);
|
||||
pm_unblock(3);
|
||||
pm_unblock(4);
|
||||
|
||||
DEBUG("release\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user