You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
375 B
C
20 lines
375 B
C
#ifndef _CORE_H_
|
|
#define _CORE_H_
|
|
|
|
#include "sam.h"
|
|
|
|
void mcu_init(void);
|
|
|
|
void atomic_enter_critical(uint32_t volatile* atomic);
|
|
void atomic_leave_critical(uint32_t volatile* atomic);
|
|
|
|
#define CRITICAL_SECTION_ENTER() \
|
|
{\
|
|
volatile uint32_t __atomic;\
|
|
atomic_enter_critical(&__atomic);
|
|
|
|
#define CRITICAL_SECTION_LEAVE() \
|
|
atomic_leave_critical(&__atomic); \
|
|
}
|
|
#endif
|