samples: canbus: isotp: exit if RX thread creation failed, name threads

Exit the sample if creation of any of the RX threads failed. Name the
threads to aid in debugging and monitoring of this sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2023-08-22 11:27:09 +02:00 committed by Carles Cufí
commit b9585ad96d

View file

@ -170,7 +170,9 @@ int main(void)
CONFIG_SAMPLE_RX_THREAD_PRIORITY, 0, K_NO_WAIT);
if (!tid) {
printk("ERROR spawning rx thread\n");
return 0;
}
k_thread_name_set(tid, "rx_8_0");
tid = k_thread_create(&rx_0_5_thread_data, rx_0_5_thread_stack,
K_THREAD_STACK_SIZEOF(rx_0_5_thread_stack),
@ -178,7 +180,9 @@ int main(void)
CONFIG_SAMPLE_RX_THREAD_PRIORITY, 0, K_NO_WAIT);
if (!tid) {
printk("ERROR spawning rx thread\n");
return 0;
}
k_thread_name_set(tid, "rx_0_5");
printk("Start sending data\n");