You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2022/04/09 14:18:09 UTC

[mynewt-core] branch master updated: tinyusb: Tickle watchdog in bootloader

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 71f6acbec tinyusb: Tickle watchdog in bootloader
71f6acbec is described below

commit 71f6acbec4a284621a461b9e7d02759eed9af897
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Tue Mar 15 12:41:28 2022 +0100

    tinyusb: Tickle watchdog in bootloader
    
    When TinyUSB was enabled in bootloader (for DFU) and Watchdog was
    enabled device resets all the time because TinyUSB loop did not feed
    watchdog.
    
    Now for bootloader build watchdog is handled when tinyusb takes over.
---
 hw/usb/tinyusb/src/tinyusb.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/usb/tinyusb/src/tinyusb.c b/hw/usb/tinyusb/src/tinyusb.c
index d61bbbbb4..48bc1ab47 100755
--- a/hw/usb/tinyusb/src/tinyusb.c
+++ b/hw/usb/tinyusb/src/tinyusb.c
@@ -19,6 +19,7 @@
 
 
 #include <os/mynewt.h>
+#include <hal/hal_watchdog.h>
 #include <device/usbd.h>
 
 #include <tusb.h>
@@ -43,6 +44,9 @@ tinyusb_device_task(void *param)
     (void)param;
 
     while (1) {
+#if !MYNEWT_VAL(OS_SCHEDULING) && MYNEWT_VAL(WATCHDOG_INTERVAL)
+        hal_watchdog_tickle();
+#endif
         tud_task();
     }
 }