尘归尘
尘归尘
这家伙很懒,什么也没写!

注册于 1年前

回答
2
文章
0
关注者
0

发布于1年前

rt-thread有专门的原子操作api呀 v5.0.0已经支持 我已经拿到v4.1.x上用了

  1. rt_atomic_t rt_hw_atomic_load(volatile rt_atomic_t *ptr);
  2. void rt_hw_atomic_store(volatile rt_atomic_t *ptr, rt_atomic_t val);
  3. rt_atomic_t rt_hw_atomic_add(volatile rt_atomic_t *ptr, rt_atomic_t val);
  4. rt_atomic_t rt_hw_atomic_sub(volatile rt_atomic_t *ptr, rt_atomic_t val);
  5. rt_atomic_t rt_hw_atomic_and(volatile rt_atomic_t *ptr, rt_atomic_t val);
  6. rt_atomic_t rt_hw_atomic_or(volatile rt_atomic_t *ptr, rt_atomic_t val);
  7. rt_atomic_t rt_hw_atomic_xor(volatile rt_atomic_t *ptr, rt_atomic_t val);
  8. rt_atomic_t rt_hw_atomic_exchange(volatile rt_atomic_t *ptr, rt_atomic_t val);
  9. void rt_hw_atomic_flag_clear(volatile rt_atomic_t *ptr);
  10. rt_atomic_t rt_hw_atomic_flag_test_and_set(volatile rt_atomic_t *ptr);
  11. rt_atomic_t rt_hw_atomic_compare_exchange_strong(volatile rt_atomic_t *ptr, rt_atomic_t *old, rt_atomic_t new);

发布于1年前

因为ulog的同步机制rt_mutex_take检测RT_DEBUG_SCHEDULER_AVAILABLE(RT_TRUE);时报错,啥什么要检查scheduler 不明白

  1. void ulog_voutput(rt_uint32_t level, const char *tag, rt_bool_t newline, const char *format, va_list args)
  2. {
  3. output_lock();//rt_mutex_take(&ulog.output_locker, RT_WAITING_FOREVER);
  4. output_unlock();
  5. }

回到
顶部

发布
问题

投诉
建议