mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-29 03:03:13 +01:00
ARM: Remove dbg_format_msg() which can be done via printf() now that mutex used.
This commit is contained in:
@@ -33,12 +33,12 @@
|
||||
/* Include Atomthreads kernel API */
|
||||
#include "atom.h"
|
||||
|
||||
/* Prerequisite for ATOMLOG() macro (via dbg_format_msg) */
|
||||
extern void dbg_format_msg (char *format, ...) ;
|
||||
/* Include printf for ATOMLOG() */
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/* Logger macro for viewing test results */
|
||||
#define ATOMLOG dbg_format_msg
|
||||
#define ATOMLOG printf
|
||||
|
||||
/*
|
||||
* String location macro: for platforms which need to place strings in
|
||||
|
||||
@@ -48,28 +48,6 @@ ICP_PIC_T * const board_pic = (ICP_PIC_T*)BOARD_BASE_ADDRESS_PIC;
|
||||
#define TIMER0_CLOCK_SPEED 40000000
|
||||
|
||||
|
||||
/**
|
||||
* \b dbg_format_msg
|
||||
*
|
||||
* Same as printf.
|
||||
*
|
||||
*/
|
||||
void
|
||||
dbg_format_msg (char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
static char msg[256] ;
|
||||
CRITICAL_STORE ;
|
||||
|
||||
va_start (args, format) ;
|
||||
CRITICAL_START() ;
|
||||
vsnprintf ((char*)msg, 256, (char*)format, args) ;
|
||||
printf (msg) ;
|
||||
CRITICAL_END() ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \b _mainCRTStartup
|
||||
*
|
||||
|
||||
@@ -121,9 +121,6 @@ extern ICP_PIC_T* const board_pic ;
|
||||
|
||||
/* Function prototypes */
|
||||
extern int low_level_init (void) ;
|
||||
extern void dbg_format_msg (char *format, ...) ;
|
||||
|
||||
#define DBG_MESSAGE(fmt_str) { dbg_format_msg fmt_str ; }
|
||||
|
||||
|
||||
#endif /* __MODULES_H__ */
|
||||
|
||||
@@ -75,13 +75,13 @@ monitor_thread (uint32_t parm)
|
||||
uint32_t time = atomTimeGet() ;
|
||||
|
||||
CRITICAL_START();
|
||||
ATOMLOG (_STR("\r\nMonitor %d threads # %d (%08d)\r\n"), parm, counter, (unsigned int)time) ;
|
||||
ATOMLOG (_STR("\r\nMonitor %d threads # %d (%08d)\r\n"), (int)parm, counter, (unsigned int)time) ;
|
||||
ATOMLOG (_STR("------------------------------\r\n")) ;
|
||||
//CRITICAL_END();
|
||||
|
||||
for (i=0; i<print_lines_count; i++) {
|
||||
//CRITICAL_START();
|
||||
ATOMLOG (_STR("Thr %.2d cnt %08d\tThr %.2d cnt %08d\tThr %.2d cnt %08d\tThr %.2d cnt %08d\r\n"),
|
||||
ATOMLOG (_STR("Thr %.2d cnt %08d\tThr %.2lu cnt %08d\tThr %.2lu cnt %08d\tThr %.2lu cnt %08d\r\n"),
|
||||
i,test_counter[i],
|
||||
i+print_lines_count,test_counter[i+print_lines_count],
|
||||
i+print_lines_count*2,test_counter[i+print_lines_count*2],
|
||||
@@ -127,7 +127,7 @@ uint32_t test_start (void)
|
||||
|
||||
for (i=0; i< TEST_THREADS;i++) {
|
||||
CRITICAL_START();
|
||||
ATOMLOG (_STR("stress_test_thread %.3d creating...\r\n"), i) ;
|
||||
ATOMLOG (_STR("stress_test_thread %.3d creating...\r\n"), (int)i) ;
|
||||
CRITICAL_END();
|
||||
if (atomThreadCreate ((ATOM_TCB *)&test_tcb[i], test_prio[i], stress_test_thread, i,
|
||||
&stress_test_stack[i][0], TEST_STACK_BYTE_SIZE, TRUE) != ATOM_OK) {
|
||||
@@ -159,7 +159,7 @@ atomthreads_stress_test (uint32_t thread_count)
|
||||
thread_count = MAX_TEST_THREADS ;
|
||||
}
|
||||
|
||||
ATOMLOG (_STR("\r\natomthreads_stress_test %.3d threads\r\n"), thread_count) ;
|
||||
ATOMLOG (_STR("\r\natomthreads_stress_test %.3d threads\r\n"), (int)thread_count) ;
|
||||
ATOMLOG (_STR("-----------------------------------\r\n")) ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user