Updated ARM example

This commit is contained in:
John Wellbelove 2018-08-09 20:36:25 +01:00
parent 0c2c7f67d8
commit 079904c73c
3 changed files with 21 additions and 5 deletions

View File

@ -336,7 +336,7 @@
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath>..\..\src;..\ArmTimerCallbacks - C++</IncludePath>
<IncludePath>..\..\include;..\ArmTimerCallbacks - C++</IncludePath>
</VariousControls>
</Cads>
<Aads>

View File

@ -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

View File

@ -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;