Skip to content

Commit d2fb578

Browse files
committed
clean up
1 parent d900149 commit d2fb578

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

cores/nRF5/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static void loop_task(void* arg)
5656
while (1)
5757
{
5858
loop();
59-
yield(); // yield run usb background task
59+
yield(); // yield to run other task
6060

6161
// Serial events
6262
if (serialEvent && serialEventRun) serialEventRun();

cores/nRF5/rtos.h

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ enum
6666
#define tick2us(tck) ( ( ((uint64_t)(tck)) * 1000000) / configTICK_RATE_HZ )
6767

6868
#define malloc_type(type) rtos_malloc( sizeof(type) )
69-
70-
#if 0
71-
#define rtos_malloc(_size) ({ printf("[malloc] %s:%d : %d bytes\r\n", __PRETTY_FUNCTION__, __LINE__, _size); pvPortMalloc(_size); })
72-
#define rtos_free(ptr) ({ printf("[free] %s:%d\r\n" ,__PRETTY_FUNCTION__, __LINE__/*malloc_usable_size(ptr)*/); vPortFree(ptr); })
73-
#else
74-
7569
#define rtos_malloc_type(_type) (_type*) rtos_malloc(sizeof(_type))
7670

7771
static inline void* rtos_malloc(size_t _size)
@@ -84,9 +78,8 @@ static inline void rtos_free( void *pv )
8478
return (xTaskGetSchedulerState() == taskSCHEDULER_NOT_STARTED) ? free(pv) : vPortFree(pv);
8579
}
8680

87-
#endif
88-
89-
#ifdef __cplusplus // Visible only with cplusplus
81+
// Visible only with C++
82+
#ifdef __cplusplus
9083

9184
#define SCHEDULER_STACK_SIZE_DFLT (512*2)
9285

@@ -106,7 +99,6 @@ class SchedulerRTOS
10699

107100
extern SchedulerRTOS Scheduler;
108101

109-
#endif
110-
102+
#endif // __cplusplus
111103

112104
#endif /* RTOS_H_ */

0 commit comments

Comments
 (0)