Revision 1a8fb642 modules/NUCLEO-F401RE/module.h
modules/NUCLEO-F401RE/module.h | ||
---|---|---|
91 | 91 |
/** |
92 | 92 |
* @brief Event flag to be set on a USER_BUTTON interrupt. |
93 | 93 |
*/ |
94 |
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
94 |
#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
95 | 95 |
|
96 | 96 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
97 | 97 |
/** |
... | ... | |
106 | 106 |
*/ |
107 | 107 |
#define MODULE_INIT_INTERRUPTS() { \ |
108 | 108 |
/* user button */ \ |
109 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line); \
|
|
109 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line); \
|
|
110 | 110 |
palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge)); \ |
111 | 111 |
} |
112 | 112 |
|
113 | 113 |
/** |
114 |
* @brief Unit test initialization hook.
|
|
114 |
* @brief Test initialization hook.
|
|
115 | 115 |
*/ |
116 | 116 |
#define MODULE_INIT_TESTS() { \ |
117 |
/* add unit-test shell commands */ \
|
|
117 |
/* add test commands to shell */ \
|
|
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
/** |
... | ... | |
129 | 129 |
* @brief Periphery communication interface deinitialization hook. |
130 | 130 |
*/ |
131 | 131 |
#define MODULE_SHUTDOWN_PERIPHERY_IF() { \ |
132 |
/* don't stop the serial driver so messages can still be printed */ \ |
|
132 | 133 |
} |
133 | 134 |
|
134 | 135 |
/** |
135 | 136 |
* @brief HOOK to toggle the LEDs when the user button is pressed. |
136 | 137 |
*/ |
137 |
#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) { \
|
|
138 |
if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) { \
|
|
138 |
#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) { \
|
|
139 |
if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) { \
|
|
139 | 140 |
apalControlGpioState_t buttonstate; \ |
140 | 141 |
apalControlGpioGet(&moduleGpioUserButton, &buttonstate); \ |
141 | 142 |
apalControlGpioSet(&moduleGpioLed, buttonstate); \ |
Also available in: Unified diff