Files
simtrace2/firmware/libcommon/include/utils.h
Harald Welte 3f5e3ddffc Change directory structure to align with Atmel softpack
This way we can easily check with 'diff' for differences in our code and
Atmel softpack.  Also, this layout is more suitable for building various
different firmware images (e.g. factory-test, dfu-loader, main
application) for a variety of different boards (simtrace, owhw, qmod).
2017-02-27 14:24:11 +01:00

19 lines
358 B
C

#pragma once
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
#ifdef __ARM
#define local_irq_save(x) \
({ \
x = __get_PRIMASK(); \
__disable_irq(); \
})
#define local_irq_restore(x) \
__set_PRIMASK(x)
#else
#warning "local_irq_{save,restore}() not implemented"
#define local_irq_save(x)
#define local_irq_restore(x)
#endif