mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-26 20:38:45 +08:00
Updated ARM example
This commit is contained in:
parent
0c2c7f67d8
commit
079904c73c
@ -336,7 +336,7 @@
|
||||
<MiscControls></MiscControls>
|
||||
<Define></Define>
|
||||
<Undefine></Undefine>
|
||||
<IncludePath>..\..\src;..\ArmTimerCallbacks - C++</IncludePath>
|
||||
<IncludePath>..\..\include;..\ArmTimerCallbacks - C++</IncludePath>
|
||||
</VariousControls>
|
||||
</Cads>
|
||||
<Aads>
|
||||
|
||||
@ -9,13 +9,14 @@
|
||||
#define ETL_IVECTOR_REPAIR_ENABLE
|
||||
#define ETL_IDEQUE_REPAIR_ENABLE
|
||||
#define ETL_IN_UNIT_TEST
|
||||
#define ETL_CALLBACK_TIMER_USE_ATOMIC_LOCK
|
||||
|
||||
#if (__CC_ARM == 1)
|
||||
// ARM5 compiler
|
||||
#include "profiles/armv5.h"
|
||||
#include "etl/profiles/armv5.h"
|
||||
#else
|
||||
// ARM6 compiler
|
||||
#include "profiles/armv6.h"
|
||||
#include "etl/profiles/armv6.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -9,8 +9,23 @@ extern "C"
|
||||
#include "stm32f4xx.h" // Device header
|
||||
}
|
||||
|
||||
#include "function.h"
|
||||
#include "callback_timer.h"
|
||||
#include "etl/function.h"
|
||||
#include "etl/callback_timer.h"
|
||||
#include "etl/vector.h"
|
||||
|
||||
struct FP
|
||||
{
|
||||
void (*function)();
|
||||
};
|
||||
|
||||
static etl::vector<FP, 10> power_callbacks;
|
||||
|
||||
void register_poweroff_callback(void (*function)())
|
||||
{
|
||||
FP fp = { function };
|
||||
power_callbacks.push_back(fp);
|
||||
}
|
||||
|
||||
|
||||
const int N_TIMERS = 4;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user