#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
