include/sys/boardctl.h : Add macro of boardctl
To reset the board through sw, we should call boardctl(BOARDIOC_RESET, EXIT_SUCCESS/FAILURE).
For easy use, add macro as board_sw_reset()
****************************************************************************/
#include <tinyara/config.h>
#include <stdint.h>
+#include <stdlib.h>
#include <tinyara/fs/ioctl.h>
@@ -169,5 +170,9 @@ int boardctl(unsigned int cmd, uintptr_t arg);
}
#endif
+#define board_sw_reset() do { \
+ boardctl(BOARDIOC_RESET, EXIT_SUCCESS); \
+ } while (0)
+
#endif /* CONFIG_LIB_BOARDCTL */
#endif /* __INCLUDE_SYS_BOARDCTL_H */
