8 #include PLATFORM_HEADER
11 #include "hal/micro/micro-common.h"
29 GPIO_DBGCFG &= ~GPIO_EXTREGEN;
35 #ifndef DISABLE_WATCHDOG
52 OSC24M_CTRL = OSC24M_CTRL_RESET;
53 CPU_CLKSEL = CPU_CLKSEL_RESET;
55 SCS_AIRCR = (0x05FA0000 | SCS_AIRCR_SYSRESETREQ);
73 static uint16_t seed0 = 0xbeef;
74 static uint16_t seed1 = 0xface;
78 seed0 = (uint16_t) seed;
81 seed1 = (uint16_t) (seed >> 16);
86 static uint16_t shift(uint16_t *val, uint16_t taps)
88 uint16_t newVal = *val;
98 return (shift(&seed0, 0x0062)
99 ^ shift(&seed1, 0x100B));
102 void halCommonMemCopy(
void *dest,
const void *source, uint8_t bytes)
104 memcpy(dest, source, bytes);
107 int8_t halCommonMemCompare(
const void *source0,
const void *source1, uint8_t bytes)
109 return memcmp(source0, source1, bytes);
112 void halCommonMemSet(
void *dest, uint8_t val, uint16_t bytes)
114 memset(dest, val, bytes);
118 typedef struct appSwitchStruct {
126 } appSwitchStructType;
128 static appSwitchStructType *appSwitch = (appSwitchStructType *) RAM_BOTTOM;
133 uint8_t cut = *(
volatile uint8_t *) 0x08040798;
134 if (!( (halFixedAddressTable.baseTable.type == FIXED_ADDRESS_TABLE_TYPE) &&
135 ( ( (halFixedAddressTable.baseTable.version & FAT_MAJOR_VERSION_MASK)
137 (halFixedAddressTable.baseTable.version == 0x0003)
138 ) && (cut >= 2) && (cut <= 3)))
145 appSwitch->param.panID = panID;
151 appSwitch->mode = mode;