2024-05-28 02:25 PM
I need to make a "multi threaded" application, my mentor told me this, and I quote
"
int main(void){
uint8_t done{0};
while (1)
{
thread_Xms(&done);
if(done & 1)
{// exactly 1 ms loop
function_LED_1ms(); //< no any delay sould be contains!!!
function_Input_1ms();//< no any delay sould be contains!!!
function_ETC_1ms(); //< no any delay sould be contains!!!
}
if(done & 0x80)
{// exactly 1 sec loop for example
// TODO something every 1 sec
}
}
}
2024-05-28 04:12 PM - edited 2024-05-28 04:17 PM
>I do not really understand this
Better ask him, to avoid "broken phone" situation. People that teach software in various schools often have peculiar ideas about software, different from what professional developers can suggest.
Just note that he prefers C++, because of syntax in line 3.