Revision 1a8fb642 modules/STM32F407G-DISC1/module.h
modules/STM32F407G-DISC1/module.h | ||
---|---|---|
133 | 133 |
/** |
134 | 134 |
* @brief Event flag to be set on a USER_BUTTON interrupt. |
135 | 135 |
*/ |
136 |
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
136 |
#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
137 | 137 |
|
138 | 138 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
139 | 139 |
/** |
... | ... | |
148 | 148 |
*/ |
149 | 149 |
#define MODULE_INIT_INTERRUPTS() { \ |
150 | 150 |
/* user button */ \ |
151 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line); \
|
|
151 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line); \
|
|
152 | 152 |
palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge)); \ |
153 | 153 |
} |
154 | 154 |
|
155 | 155 |
/** |
156 |
* @brief Unit test initialization hook.
|
|
156 |
* @brief Test initialization hook.
|
|
157 | 157 |
*/ |
158 | 158 |
#define MODULE_INIT_TESTS() { \ |
159 |
/* add unit-test shell commands */ \
|
|
159 |
/* add test commands to shell */ \
|
|
160 | 160 |
} |
161 | 161 |
|
162 | 162 |
/** |
... | ... | |
171 | 171 |
* @brief Periphery communication interface deinitialization hook. |
172 | 172 |
*/ |
173 | 173 |
#define MODULE_SHUTDOWN_PERIPHERY_IF() { \ |
174 |
/* don't stop the serial driver so messages can still be printed */ \ |
|
174 | 175 |
} |
175 | 176 |
|
176 | 177 |
/** |
177 | 178 |
* @brief HOOK to toggle the LEDs when the user button is pressed. |
178 | 179 |
*/ |
179 |
#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) { \
|
|
180 |
if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) { \
|
|
180 |
#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) { \
|
|
181 |
if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) { \
|
|
181 | 182 |
apalControlGpioState_t buttonstate; \ |
182 | 183 |
apalControlGpioGet(&moduleGpioUserButton, &buttonstate); \ |
183 | 184 |
apalControlGpioSet(&moduleGpioLedRed, buttonstate); \ |
Also available in: Unified diff