[core] Print errors about starting main task
This commit is contained in:
@@ -23,7 +23,7 @@ bool startMainTask() {
|
||||
&mainThread,
|
||||
THD_APPLICATION_PRIORITY,
|
||||
"main",
|
||||
(beken_thread_function_t)main_task,
|
||||
(beken_thread_function_t)mainTask,
|
||||
8192,
|
||||
NULL
|
||||
);
|
||||
|
||||
@@ -21,7 +21,7 @@ void initVariant() __attribute__((weak));
|
||||
// Initialize C library
|
||||
extern "C" void __libc_init_array(void);
|
||||
|
||||
void main_task(const void *arg) {
|
||||
void mainTask(const void *arg) {
|
||||
setup();
|
||||
|
||||
for (;;) {
|
||||
@@ -46,7 +46,9 @@ int main(void) {
|
||||
// provide root partition
|
||||
fal_root_part = (fal_partition_t)fal_partition_find("root");
|
||||
// start the main task and OS kernel
|
||||
startMainTask();
|
||||
if (!startMainTask()) {
|
||||
LT_E("Couldn't start the main task");
|
||||
}
|
||||
|
||||
while (1) {}
|
||||
return 0;
|
||||
|
||||
@@ -9,7 +9,9 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Run main_task & start OS kernel (family-defined)
|
||||
* @brief Run mainTask & start OS kernel (family-defined).
|
||||
* Return false if an error occured; else do not return and
|
||||
* and keep the OS kernel running.
|
||||
*/
|
||||
extern bool startMainTask();
|
||||
|
||||
@@ -17,7 +19,7 @@ extern bool startMainTask();
|
||||
* @brief Main setup() and loop() task.
|
||||
* Not to be called directly.
|
||||
*/
|
||||
extern void main_task(const void *arg);
|
||||
extern void mainTask(const void *arg);
|
||||
|
||||
#define PIN_NONE (1 << 0)
|
||||
#define PIN_GPIO (1 << 1)
|
||||
|
||||
@@ -23,8 +23,8 @@ void initArduino() {
|
||||
}
|
||||
|
||||
bool startMainTask() {
|
||||
osThreadDef(main_task, osPriorityRealtime, 1, 4096 * 4);
|
||||
main_tid = osThreadCreate(osThread(main_task), NULL);
|
||||
osThreadDef(mainTask, osPriorityRealtime, 1, 4096 * 4);
|
||||
main_tid = osThreadCreate(osThread(mainTask), NULL);
|
||||
osKernelStart();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user