mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-17 05:38:33 +03:00
ringbuffer: Make ring buffer access irq-save
We have to temporarily disable nterrupts when performing rinbuffer operations, as the ring buffer is used both from IRQ as well as process context.
This commit is contained in:
@@ -77,10 +77,16 @@
|
||||
* This includes EFC and master clock configuration.
|
||||
* It also enable a low level on the pin NRST triggers a user reset.
|
||||
*/
|
||||
#define _LED_GREN (1 << 18)
|
||||
#define _LED_RED (1 << 17)
|
||||
extern WEAK void LowLevelInit( void )
|
||||
{
|
||||
uint32_t timeout = 0;
|
||||
|
||||
PIOA->PIO_PER |= _LED_RED | _LED_GREN;
|
||||
PIOA->PIO_OER |= _LED_RED | _LED_GREN;
|
||||
PIOA->PIO_CODR |= _LED_RED | _LED_GREN;
|
||||
|
||||
/* Set 3 FWS for Embedded Flash Access */
|
||||
EFC->EEFC_FMR = EEFC_FMR_FWS(3);
|
||||
|
||||
@@ -110,6 +116,8 @@ extern WEAK void LowLevelInit( void )
|
||||
timeout = 0;
|
||||
while (!(PMC->PMC_SR & PMC_SR_MOSCSELS) && (timeout++ < CLOCK_TIMEOUT));
|
||||
|
||||
PIOA->PIO_SODR = _LED_RED;
|
||||
|
||||
/* "switch" to main clock as master clock source (should already be the case */
|
||||
PMC->PMC_MCKR = (PMC->PMC_MCKR & ~(uint32_t)PMC_MCKR_CSS_Msk) | PMC_MCKR_CSS_MAIN_CLK;
|
||||
/* wait for master clock to be ready */
|
||||
|
||||
Reference in New Issue
Block a user