From 0967e03c97014f745ec0b76b0a6bf54160faee3d Mon Sep 17 00:00:00 2001 From: giripriyadarshan Date: Thu, 18 Feb 2021 20:34:58 +0530 Subject: [PATCH 1/4] Changed unique_board_id example --- system/unique_board_id/CMakeLists.txt | 4 ++++ system/unique_board_id/unique_board_id.c | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/system/unique_board_id/CMakeLists.txt b/system/unique_board_id/CMakeLists.txt index 1a5b1f989..e17660868 100644 --- a/system/unique_board_id/CMakeLists.txt +++ b/system/unique_board_id/CMakeLists.txt @@ -12,3 +12,7 @@ pico_add_extra_outputs(unique_board_id) # add url via pico_set_program_url example_auto_set_url(unique_board_id) + +# enable both, usb output and uart output +pico_enable_stdio_usb(unique_board_id 1) +pico_enable_stdio_uart(unique_board_id 1) \ No newline at end of file diff --git a/system/unique_board_id/unique_board_id.c b/system/unique_board_id/unique_board_id.c index 6fb06c714..5ae01a3d2 100644 --- a/system/unique_board_id/unique_board_id.c +++ b/system/unique_board_id/unique_board_id.c @@ -24,9 +24,13 @@ int main() { pico_unique_board_id_t board_id; pico_get_unique_board_id(&board_id); - printf("Unique identifier:"); - for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { - printf(" %02x", board_id.id[i]); - } - printf("\n"); + while(1) { + printf("Unique identifier:"); + for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { + printf(" %02x", board_id.id[i]); + } + printf("\n"); + + sleep_ms(2000); + } } From 0fb71d5e9eacaa9e851d21450aad571fa0f79052 Mon Sep 17 00:00:00 2001 From: giripriyadarshan <43517605+giripriyadarshan@users.noreply.github.com> Date: Sun, 6 Jun 2021 15:43:32 +0530 Subject: [PATCH 2/4] re-indented and vim says it is spaces not tabs --- system/unique_board_id/unique_board_id.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/unique_board_id/unique_board_id.c b/system/unique_board_id/unique_board_id.c index 5ae01a3d2..e4549a59c 100644 --- a/system/unique_board_id/unique_board_id.c +++ b/system/unique_board_id/unique_board_id.c @@ -25,12 +25,12 @@ int main() { pico_get_unique_board_id(&board_id); while(1) { - printf("Unique identifier:"); - for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { - printf(" %02x", board_id.id[i]); - } - printf("\n"); + printf("Unique identifier:"); + for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { + printf(" %02x", board_id.id[i]); + } + printf("\n"); - sleep_ms(2000); - } + sleep_ms(2000); + } } From e64c4e9cc75415368434c0d5bcea1001031386f5 Mon Sep 17 00:00:00 2001 From: giripriyadarshan Date: Thu, 18 Feb 2021 20:34:58 +0530 Subject: [PATCH 3/4] Changed unique_board_id example --- system/unique_board_id/CMakeLists.txt | 4 ++++ system/unique_board_id/unique_board_id.c | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/system/unique_board_id/CMakeLists.txt b/system/unique_board_id/CMakeLists.txt index 1a5b1f989..e17660868 100644 --- a/system/unique_board_id/CMakeLists.txt +++ b/system/unique_board_id/CMakeLists.txt @@ -12,3 +12,7 @@ pico_add_extra_outputs(unique_board_id) # add url via pico_set_program_url example_auto_set_url(unique_board_id) + +# enable both, usb output and uart output +pico_enable_stdio_usb(unique_board_id 1) +pico_enable_stdio_uart(unique_board_id 1) \ No newline at end of file diff --git a/system/unique_board_id/unique_board_id.c b/system/unique_board_id/unique_board_id.c index 6fb06c714..5ae01a3d2 100644 --- a/system/unique_board_id/unique_board_id.c +++ b/system/unique_board_id/unique_board_id.c @@ -24,9 +24,13 @@ int main() { pico_unique_board_id_t board_id; pico_get_unique_board_id(&board_id); - printf("Unique identifier:"); - for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { - printf(" %02x", board_id.id[i]); - } - printf("\n"); + while(1) { + printf("Unique identifier:"); + for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { + printf(" %02x", board_id.id[i]); + } + printf("\n"); + + sleep_ms(2000); + } } From 16fdab4cd2a4418a0bbb9d823bf980dbe2c6d529 Mon Sep 17 00:00:00 2001 From: giripriyadarshan <43517605+giripriyadarshan@users.noreply.github.com> Date: Sun, 6 Jun 2021 15:43:32 +0530 Subject: [PATCH 4/4] re-indented and vim says it is spaces not tabs --- system/unique_board_id/unique_board_id.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/system/unique_board_id/unique_board_id.c b/system/unique_board_id/unique_board_id.c index 5ae01a3d2..e4549a59c 100644 --- a/system/unique_board_id/unique_board_id.c +++ b/system/unique_board_id/unique_board_id.c @@ -25,12 +25,12 @@ int main() { pico_get_unique_board_id(&board_id); while(1) { - printf("Unique identifier:"); - for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { - printf(" %02x", board_id.id[i]); - } - printf("\n"); + printf("Unique identifier:"); + for (int i = 0; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; ++i) { + printf(" %02x", board_id.id[i]); + } + printf("\n"); - sleep_ms(2000); - } + sleep_ms(2000); + } }