STM32F401RE threads on bare metal
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-05-28 2:25 PM
I need to make a "multi threaded" application, my mentor told me this, and I quote
"
you should create a thread by yourself
use any system timer, e.g. simple tick timer
"
I do not really understand this, but he gave me some example pseudocode, hopefully someone can decipher what he meant.
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
}
}
}
Labels:
- Labels:
-
STM32F4 Series
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-05-28 4:12 PM - edited 2024-05-28 4: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.
