mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-27 09:32:28 +08:00
fixup: debug
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -41,7 +41,6 @@
|
||||
|
||||
/* Memory Management */
|
||||
|
||||
#define RT_USING_MEMPOOL
|
||||
#define RT_USING_SMALL_MEM
|
||||
#define RT_USING_SMALL_MEM_AS_HEAP
|
||||
#define RT_USING_HEAP
|
||||
@@ -49,7 +48,7 @@
|
||||
#define RT_USING_CONSOLE
|
||||
#define RT_CONSOLEBUF_SIZE 128
|
||||
#define RT_CONSOLE_DEVICE_NAME "uart1"
|
||||
#define RT_VER_NUM 0x50100
|
||||
#define RT_VER_NUM 0x50200
|
||||
#define RT_BACKTRACE_LEVEL_MAX_NR 32
|
||||
#define RT_USING_HW_ATOMIC
|
||||
#define RT_USING_CPU_FFS
|
||||
@@ -146,15 +145,6 @@
|
||||
/* Wiced WiFi */
|
||||
|
||||
|
||||
/* CYW43012 WiFi */
|
||||
|
||||
|
||||
/* BL808 WiFi */
|
||||
|
||||
|
||||
/* CYW43439 WiFi */
|
||||
|
||||
|
||||
/* IoT Cloud */
|
||||
|
||||
|
||||
@@ -177,6 +167,9 @@
|
||||
/* u8g2: a monochrome graphic library */
|
||||
|
||||
|
||||
/* PainterEngine: A cross-platform graphics application framework written in C language */
|
||||
|
||||
|
||||
/* tools packages */
|
||||
|
||||
|
||||
@@ -196,26 +189,13 @@
|
||||
|
||||
/* peripheral libraries and drivers */
|
||||
|
||||
/* HAL & SDK Drivers */
|
||||
|
||||
/* STM32 HAL & SDK Drivers */
|
||||
|
||||
|
||||
/* Kendryte SDK */
|
||||
|
||||
|
||||
/* sensors drivers */
|
||||
|
||||
|
||||
/* touch drivers */
|
||||
|
||||
|
||||
/* AI packages */
|
||||
|
||||
|
||||
/* Signal Processing and Control Algorithm Packages */
|
||||
|
||||
|
||||
/* miscellaneous packages */
|
||||
|
||||
/* project laboratory */
|
||||
@@ -229,7 +209,7 @@
|
||||
/* Arduino libraries */
|
||||
|
||||
|
||||
/* Projects and Demos */
|
||||
/* Projects */
|
||||
|
||||
|
||||
/* Sensors */
|
||||
@@ -254,12 +234,19 @@
|
||||
|
||||
/* Other */
|
||||
|
||||
|
||||
/* Signal IO */
|
||||
|
||||
|
||||
/* Uncategorized */
|
||||
|
||||
/* Privated Packages of RealThread */
|
||||
|
||||
|
||||
/* Network Utilities */
|
||||
|
||||
|
||||
/* RT-Thread Smart */
|
||||
|
||||
#define SOC_FAMILY_STM32
|
||||
#define SOC_SERIES_STM32F1
|
||||
|
||||
|
||||
@@ -180,19 +180,15 @@ struct rt_spinlock
|
||||
|
||||
#else /* !RT_DEBUGING_SPINLOCK */
|
||||
|
||||
#define _SPIN_LOCK_DEBUG_OWNER(lock)
|
||||
#define _SPIN_UNLOCK_DEBUG_OWNER(lock)
|
||||
#define _SPIN_LOCK_DEBUG_OWNER(lock) RT_UNUSED(lock)
|
||||
#define _SPIN_UNLOCK_DEBUG_OWNER(lock) RT_UNUSED(lock)
|
||||
#endif /* RT_DEBUGING_SPINLOCK */
|
||||
|
||||
#ifdef RT_USING_DEBUG
|
||||
#define _SPIN_LOCK_DEBUG_CRITICAL(lock) \
|
||||
do \
|
||||
{ \
|
||||
struct rt_thread *_curthr = rt_thread_self(); \
|
||||
if (_curthr != RT_NULL) \
|
||||
{ \
|
||||
(lock)->critical_level = rt_critical_level(); \
|
||||
} \
|
||||
#define _SPIN_LOCK_DEBUG_CRITICAL(lock) \
|
||||
do \
|
||||
{ \
|
||||
(lock)->critical_level = rt_critical_level(); \
|
||||
} while (0)
|
||||
|
||||
#define _SPIN_UNLOCK_DEBUG_CRITICAL(lock, critical) \
|
||||
@@ -202,8 +198,8 @@ struct rt_spinlock
|
||||
} while (0)
|
||||
|
||||
#else /* !RT_USING_DEBUG */
|
||||
#define _SPIN_LOCK_DEBUG_CRITICAL(lock)
|
||||
#define _SPIN_UNLOCK_DEBUG_CRITICAL(lock, critical) (critical = 0)
|
||||
#define _SPIN_LOCK_DEBUG_CRITICAL(lock) RT_UNUSED(lock)
|
||||
#define _SPIN_UNLOCK_DEBUG_CRITICAL(lock, critical) do {critical = 0; RT_UNUSED(lock);} while (0)
|
||||
|
||||
#endif /* RT_USING_DEBUG */
|
||||
|
||||
|
||||
@@ -105,8 +105,8 @@ void rt_spin_unlock_irqrestore(struct rt_spinlock *lock, rt_base_t level)
|
||||
|
||||
RT_SPIN_UNLOCK_DEBUG(lock, critical_level);
|
||||
rt_hw_spin_unlock(&lock->lock);
|
||||
rt_hw_local_irq_enable(level);
|
||||
rt_exit_critical_safe(critical_level);
|
||||
rt_hw_local_irq_enable(level);
|
||||
}
|
||||
RTM_EXPORT(rt_spin_unlock_irqrestore)
|
||||
|
||||
|
||||
13
src/cpu_up.c
13
src/cpu_up.c
@@ -30,8 +30,8 @@ void rt_spin_lock_init(struct rt_spinlock *lock)
|
||||
*/
|
||||
void rt_spin_lock(struct rt_spinlock *lock)
|
||||
{
|
||||
RT_UNUSED(lock);
|
||||
rt_enter_critical();
|
||||
RT_SPIN_LOCK_DEBUG(lock);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,8 +41,9 @@ void rt_spin_lock(struct rt_spinlock *lock)
|
||||
*/
|
||||
void rt_spin_unlock(struct rt_spinlock *lock)
|
||||
{
|
||||
RT_UNUSED(lock);
|
||||
rt_exit_critical();
|
||||
rt_base_t critical_level;
|
||||
RT_SPIN_UNLOCK_DEBUG(lock, critical_level);
|
||||
rt_exit_critical_safe(critical_level);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,6 +62,7 @@ rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
|
||||
RT_UNUSED(lock);
|
||||
level = rt_hw_interrupt_disable();
|
||||
rt_enter_critical();
|
||||
RT_SPIN_LOCK_DEBUG(lock);
|
||||
return level;
|
||||
}
|
||||
|
||||
@@ -73,7 +75,8 @@ rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
|
||||
*/
|
||||
void rt_spin_unlock_irqrestore(struct rt_spinlock *lock, rt_base_t level)
|
||||
{
|
||||
RT_UNUSED(lock);
|
||||
rt_exit_critical();
|
||||
rt_base_t critical_level;
|
||||
RT_SPIN_UNLOCK_DEBUG(lock, critical_level);
|
||||
rt_exit_critical_safe(critical_level);
|
||||
rt_hw_interrupt_enable(level);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user