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 aefd2c48f tinyusb: Fix CFG_TUSB_OS for custom bootlader builds
aefd2c48f is described below

commit aefd2c48ff9569387bd1bbb62a64474e726c6848
Author: Jerzy Kasenberg <jerzy.kasenb...@codecoup.pl>
AuthorDate: Tue May 30 12:44:52 2023 +0200

    tinyusb: Fix CFG_TUSB_OS for custom bootlader builds
    
    TinyUSB build with mcuboot allows to have DFU or MSC for firmware update.
    In such case there is no mynewt scheduling and USB task takes over CPU.
    
    However for custom builds (without mcuboot) mynewt can run normal os
    scheduling while having BOOT_LOADER set to 1 for linking into boot
    area.
    
    Now std_descriptors tusb_config.h checks for OS_SCHEDULING instead
    of BOOT_LOADER to decided if TinyUSB should run in mynewt os mode
    or bare metal one.
---
 hw/usb/tinyusb/std_descriptors/include/tusb_config.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/usb/tinyusb/std_descriptors/include/tusb_config.h 
b/hw/usb/tinyusb/std_descriptors/include/tusb_config.h
index c6933cf67..26b25c7b0 100755
--- a/hw/usb/tinyusb/std_descriptors/include/tusb_config.h
+++ b/hw/usb/tinyusb/std_descriptors/include/tusb_config.h
@@ -44,10 +44,10 @@ extern "C" {
 
 #define CFG_TUSB_RHPORT0_MODE       ((OPT_MODE_DEVICE) | 
(CFG_TUSB_RHPORT0_SPEED))
 
-#if MYNEWT_VAL(BOOT_LOADER)
-#define CFG_TUSB_OS                 OPT_OS_NONE
-#else
+#if MYNEWT_VAL(OS_SCHEDULING)
 #define CFG_TUSB_OS                 OPT_OS_MYNEWT
+#else
+#define CFG_TUSB_OS                 OPT_OS_NONE
 #endif
 #define CFG_TUSB_DEBUG              MYNEWT_VAL(CFG_TUSB_DEBUG)
 

Reply via email to