diff --git a/cores/nRF5/main.cpp b/cores/nRF5/main.cpp index 7d79b9bb..b40e44e1 100644 --- a/cores/nRF5/main.cpp +++ b/cores/nRF5/main.cpp @@ -56,7 +56,7 @@ static void loop_task(void* arg) while (1) { loop(); - yield(); // yield run usb background task + yield(); // yield to run other task // Serial events if (serialEvent && serialEventRun) serialEventRun(); diff --git a/cores/nRF5/rtos.h b/cores/nRF5/rtos.h index 3c63def4..49fef4a6 100644 --- a/cores/nRF5/rtos.h +++ b/cores/nRF5/rtos.h @@ -66,12 +66,6 @@ enum #define tick2us(tck) ( ( ((uint64_t)(tck)) * 1000000) / configTICK_RATE_HZ ) #define malloc_type(type) rtos_malloc( sizeof(type) ) - -#if 0 -#define rtos_malloc(_size) ({ printf("[malloc] %s:%d : %d bytes\r\n", __PRETTY_FUNCTION__, __LINE__, _size); pvPortMalloc(_size); }) -#define rtos_free(ptr) ({ printf("[free] %s:%d\r\n" ,__PRETTY_FUNCTION__, __LINE__/*malloc_usable_size(ptr)*/); vPortFree(ptr); }) -#else - #define rtos_malloc_type(_type) (_type*) rtos_malloc(sizeof(_type)) static inline void* rtos_malloc(size_t _size) @@ -84,9 +78,8 @@ static inline void rtos_free( void *pv ) return (xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED) ? free(pv) : vPortFree(pv); } -#endif - -#ifdef __cplusplus // Visible only with cplusplus +// Visible only with C++ +#ifdef __cplusplus #define SCHEDULER_STACK_SIZE_DFLT (512*2) @@ -106,7 +99,6 @@ public: extern SchedulerRTOS Scheduler; -#endif - +#endif // __cplusplus #endif /* RTOS_H_ */