Jump to content

is it possible to add a second "app_init"


Phatline

Recommended Posts

 

i have trouble by initize my SD, Card, in sense of  i copy big Files multiple times...

and that fails when making a freertos Function for it.... or by adding it into one of the standart Functions like "Background" or by making a new Function in the Program loop...

Because of the SD-Card reacts to slow, the files to big, to much of the files....

 

i already avoidet all "for loops", and copy one file after a nother once a Program-loop-cycle....

 

when i put the copy function into the "app_init" it is functional, but of course the display is Black -feeled forever- until the program starts the first time... so the user may think the device has failed...

 

what makes me think, of an second App_init Like Function, which is only performed once, and which attribut is: it can run forever, and when its done, MIOS runs without it.

 

 

but maybe i  have not understand some basics again...

Link to comment
Share on other sites

How about multitasking?

In app_init you could create a thread/task that updates the user interface and screen and which is responsive, directly after app start.

Then, you could create another "heavy lifting" task that does calculations/sd card operations etc as needed by your app.
That task will probably need mutex locks, but can do the copy operations in the background while you can show the progress "on screen" in the first task.

Best regards,
Peter

Link to comment
Share on other sites

thx

realized that i can print LCD-Messages in the APP_init itself... :blush: -- now i entertain the user a bit with some progress.

 

i have put the heavy copy file thing into the App_init itself (512x84Kb files), this is working now, since i realized that i has only 2,2V on the SD-Card... which was a faulty core PSU.... now its working like a glance.

while a SSD1306 is working with no probs on 2,2V a SD-Card is not  -  good now i know that.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...