-/**
- * Set watchdog timer timeout.
- *
- * \param timeout 0: 16.3ms, 7: 2.1s
- */
-INLINE void wdt_init(uint8_t timeout)
-{
-#if CONFIG_WATCHDOG
- #if OS_QT
- // Create a dummy QApplication object
- if (!qApp)
- {
- int argc;
- new QApplication(argc, (char **)NULL);
- }
+#if OS_HOSTED || !CONFIG_WATCHDOG
+ /**
+ * Reset the watchdog timer.
+ */
+ INLINE void wdt_reset(void)
+ {
+ #if CONFIG_WATCHDOG
+ #if OS_QT
+ // Let Qt handle events
+ ASSERT(qApp);
+ qApp->processEvents();
+ #elif OS_POSIX
+ static struct timeval tv = { 0, 0 };
+ select(0, NULL, NULL, NULL, &tv);
+ #endif
+ #endif /* CONFIG_WATCHDOG */
+ }
+
+ /**
+ * Set watchdog timer timeout.
+ *
+ * \param timeout 0: 16.3ms, 7: 2.1s
+ */
+ INLINE void wdt_init(uint8_t timeout)
+ {
+ #if CONFIG_WATCHDOG
+ #if OS_QT
+ // Create a dummy QApplication object
+ if (!qApp)
+ {
+ int argc;
+ new QApplication(argc, (char **)NULL);
+ }
+ (void)timeout;
+ #elif OS_POSIX
+ (void)timeout; // NOP
+ #else
+ #error unknown CPU
+ #endif
+ #endif /* CONFIG_WATCHDOG */