refactor(regi2c): ana i2c master clock is enabled per request
This commit is contained in:
@@ -31,25 +31,25 @@ IRAM_ATTR void periph_rcc_exit(void)
|
||||
portEXIT_CRITICAL_SAFE(&periph_spinlock);
|
||||
}
|
||||
|
||||
uint8_t periph_rcc_acquire_enter(periph_module_t periph)
|
||||
IRAM_ATTR uint8_t periph_rcc_acquire_enter(periph_module_t periph)
|
||||
{
|
||||
periph_rcc_enter();
|
||||
return ref_counts[periph];
|
||||
}
|
||||
|
||||
void periph_rcc_acquire_exit(periph_module_t periph, uint8_t ref_count)
|
||||
IRAM_ATTR void periph_rcc_acquire_exit(periph_module_t periph, uint8_t ref_count)
|
||||
{
|
||||
ref_counts[periph] = ++ref_count;
|
||||
periph_rcc_exit();
|
||||
}
|
||||
|
||||
uint8_t periph_rcc_release_enter(periph_module_t periph)
|
||||
IRAM_ATTR uint8_t periph_rcc_release_enter(periph_module_t periph)
|
||||
{
|
||||
periph_rcc_enter();
|
||||
return ref_counts[periph] - 1;
|
||||
}
|
||||
|
||||
void periph_rcc_release_exit(periph_module_t periph, uint8_t ref_count)
|
||||
IRAM_ATTR void periph_rcc_release_exit(periph_module_t periph, uint8_t ref_count)
|
||||
{
|
||||
ref_counts[periph] = ref_count;
|
||||
periph_rcc_exit();
|
||||
|
||||
Reference in New Issue
Block a user