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:
parent
59b763add4
commit
715517b1a0
@ -40,6 +40,10 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_SMP
|
||||||
|
# include <nuttx/arch.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -50,6 +54,12 @@
|
|||||||
|
|
||||||
int main(int argc, FAR char *argv[])
|
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");
|
printf("Hello, World!!\n");
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user