examples: hello: Show CPU index when running in SMP mode

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2020-01-30 13:24:07 +09:00 committed by Alin Jerpelea
parent 59b763add4
commit 715517b1a0

View File

@ -40,6 +40,10 @@
#include <nuttx/config.h>
#include <stdio.h>
#ifdef CONFIG_SMP
# include <nuttx/arch.h>
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -50,6 +54,12 @@
int main(int argc, FAR char *argv[])
{
#ifdef CONFIG_SMP
uint32_t cpu = up_cpu_index();
printf("Hello, World from CPU%d !!\n", cpu);
#else
printf("Hello, World!!\n");
#endif
return 0;
}