ducky: debug usb issues

This commit is contained in:
Reza Jelveh 2020-12-29 20:39:48 +08:00
parent f6f9d022db
commit 978a7c9233
3 changed files with 136 additions and 128 deletions

View File

@ -1,6 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
ChibiOS - Copyright (C) 2019 /u/KeepItUnder
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -16,7 +15,7 @@
*/ */
/** /**
* @file templates/chconf.h * @file rt/templates/chconf.h
* @brief Configuration file template. * @brief Configuration file template.
* @details A copy of this file must be placed in each project directory, it * @details A copy of this file must be placed in each project directory, it
* contains the application specific kernel settings. * contains the application specific kernel settings.
@ -408,7 +407,7 @@
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#if !defined(CH_CFG_USE_OBJ_CACHES) #if !defined(CH_CFG_USE_OBJ_CACHES)
#define CH_CFG_USE_OBJ_CACHES TRUE #define CH_CFG_USE_OBJ_CACHES FALSE
#endif #endif
/** /**
@ -530,7 +529,7 @@
* @note The default is @p FALSE. * @note The default is @p FALSE.
*/ */
#if !defined(CH_DBG_SYSTEM_STATE_CHECK) #if !defined(CH_DBG_SYSTEM_STATE_CHECK)
#define CH_DBG_SYSTEM_STATE_CHECK FALSE #define CH_DBG_SYSTEM_STATE_CHECK TRUE
#endif #endif
/** /**
@ -627,15 +626,15 @@
* @brief System structure extension. * @brief System structure extension.
* @details User fields added to the end of the @p ch_system_t structure. * @details User fields added to the end of the @p ch_system_t structure.
*/ */
#define CH_CFG_SYSTEM_EXTRA_FIELDS \ #define CH_CFG_SYSTEM_EXTRA_FIELDS /* Add threads custom fields here.*/
/* Add threads custom fields here.*/
/** /**
* @brief System initialization hook. * @brief System initialization hook.
* @details User initialization code added to the @p chSysInit() function * @details User initialization code added to the @p chSysInit() function
* just before interrupts are enabled globally. * just before interrupts are enabled globally.
*/ */
#define CH_CFG_SYSTEM_INIT_HOOK() { \ #define CH_CFG_SYSTEM_INIT_HOOK() \
{ \
/* Add threads initialization code here.*/ \ /* Add threads initialization code here.*/ \
} }
@ -643,8 +642,7 @@
* @brief Threads descriptor structure extension. * @brief Threads descriptor structure extension.
* @details User fields added to the end of the @p thread_t structure. * @details User fields added to the end of the @p thread_t structure.
*/ */
#define CH_CFG_THREAD_EXTRA_FIELDS \ #define CH_CFG_THREAD_EXTRA_FIELDS /* Add threads custom fields here.*/
/* Add threads custom fields here.*/
/** /**
* @brief Threads initialization hook. * @brief Threads initialization hook.
@ -653,7 +651,8 @@
* @note It is invoked from within @p _thread_init() and implicitly from all * @note It is invoked from within @p _thread_init() and implicitly from all
* the threads creation APIs. * the threads creation APIs.
*/ */
#define CH_CFG_THREAD_INIT_HOOK(tp) { \ #define CH_CFG_THREAD_INIT_HOOK(tp) \
{ \
/* Add threads initialization code here.*/ \ /* Add threads initialization code here.*/ \
} }
@ -661,7 +660,8 @@
* @brief Threads finalization hook. * @brief Threads finalization hook.
* @details User finalization code added to the @p chThdExit() API. * @details User finalization code added to the @p chThdExit() API.
*/ */
#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ #define CH_CFG_THREAD_EXIT_HOOK(tp) \
{ \
/* Add threads finalization code here.*/ \ /* Add threads finalization code here.*/ \
} }
@ -669,21 +669,24 @@
* @brief Context switch hook. * @brief Context switch hook.
* @details This hook is invoked just before switching between threads. * @details This hook is invoked just before switching between threads.
*/ */
#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ #define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) \
{ \
/* Context switch code here.*/ \ /* Context switch code here.*/ \
} }
/** /**
* @brief ISR enter hook. * @brief ISR enter hook.
*/ */
#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ #define CH_CFG_IRQ_PROLOGUE_HOOK() \
{ \
/* IRQ prologue code here.*/ \ /* IRQ prologue code here.*/ \
} }
/** /**
* @brief ISR exit hook. * @brief ISR exit hook.
*/ */
#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ #define CH_CFG_IRQ_EPILOGUE_HOOK() \
{ \
/* IRQ epilogue code here.*/ \ /* IRQ epilogue code here.*/ \
} }
@ -693,7 +696,8 @@
* should be invoked from here. * should be invoked from here.
* @note This macro can be used to activate a power saving mode. * @note This macro can be used to activate a power saving mode.
*/ */
#define CH_CFG_IDLE_ENTER_HOOK() { \ #define CH_CFG_IDLE_ENTER_HOOK() \
{ \
/* Idle-enter code here.*/ \ /* Idle-enter code here.*/ \
} }
@ -703,7 +707,8 @@
* should be invoked from here. * should be invoked from here.
* @note This macro can be used to deactivate a power saving mode. * @note This macro can be used to deactivate a power saving mode.
*/ */
#define CH_CFG_IDLE_LEAVE_HOOK() { \ #define CH_CFG_IDLE_LEAVE_HOOK() \
{ \
/* Idle-leave code here.*/ \ /* Idle-leave code here.*/ \
} }
@ -711,7 +716,8 @@
* @brief Idle Loop hook. * @brief Idle Loop hook.
* @details This hook is continuously invoked by the idle thread loop. * @details This hook is continuously invoked by the idle thread loop.
*/ */
#define CH_CFG_IDLE_LOOP_HOOK() { \ #define CH_CFG_IDLE_LOOP_HOOK() \
{ \
/* Idle loop code here.*/ \ /* Idle loop code here.*/ \
} }
@ -720,7 +726,8 @@
* @details This hook is invoked in the system tick handler immediately * @details This hook is invoked in the system tick handler immediately
* after processing the virtual timers queue. * after processing the virtual timers queue.
*/ */
#define CH_CFG_SYSTEM_TICK_HOOK() { \ #define CH_CFG_SYSTEM_TICK_HOOK() \
{ \
/* System tick event code here.*/ \ /* System tick event code here.*/ \
} }
@ -729,7 +736,8 @@
* @details This hook is invoked in case to a system halting error before * @details This hook is invoked in case to a system halting error before
* the system is halted. * the system is halted.
*/ */
#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ #define CH_CFG_SYSTEM_HALT_HOOK(reason) \
{ \
/* System halt code here.*/ \ /* System halt code here.*/ \
} }
@ -738,7 +746,8 @@
* @details This hook is invoked each time a new record is written in the * @details This hook is invoked each time a new record is written in the
* trace buffer. * trace buffer.
*/ */
#define CH_CFG_TRACE_HOOK(tep) { \ #define CH_CFG_TRACE_HOOK(tep) \
{ \
/* Trace code here.*/ \ /* Trace code here.*/ \
} }

View File

@ -1,6 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
ChibiOS - Copyright (C) 2019 /u/KeepItUnder
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -26,8 +25,8 @@
* @{ * @{
*/ */
#ifndef _HALCONF_H_ #ifndef HALCONF_H
#define _HALCONF_H_ #define HALCONF_H
#define _CHIBIOS_HAL_CONF_ #define _CHIBIOS_HAL_CONF_
#define _CHIBIOS_HAL_CONF_VER_7_0_ #define _CHIBIOS_HAL_CONF_VER_7_0_
@ -527,6 +526,6 @@
#define WSPI_USE_MUTUAL_EXCLUSION TRUE #define WSPI_USE_MUTUAL_EXCLUSION TRUE
#endif #endif
#endif /* _HALCONF_H_ */ #endif /* HALCONF_H */
/** @} */ /** @} */

View File

@ -15,8 +15,8 @@ MCU_LDSCRIPT = NUC123xD4xx0
# startup code to use # startup code to use
MCU_STARTUP = NUC123 MCU_STARTUP = NUC123
# BOARD = NUC123SD4AN0 BOARD = NUC123SD4AN0
BOARD = NUTINY-SDK-NUC123-V2.0 # BOARD = NUTINY-SDK-NUC123-V2.0
# NUC123 series is Cortex M0 # NUC123 series is Cortex M0
MCU = cortex-m0 MCU = cortex-m0
@ -39,7 +39,7 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output AUDIO_ENABLE = no # Audio output
DIP_SWITCH_ENABLE = yes DIP_SWITCH_ENABLE = no
# Enter lower-power sleep mode when on the ChibiOS idle thread # Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE