As the change fixes the problem I'll spend some more time to run all my test-code with this new setting to see if everything still works fine. Once I found out my password for the ObEx I also might check in a new version which gives the possibility to select FAST_CLK or SLOW_CLK - something like that.
So far tested:
all demos still work even if w500ns is set to 200
Looks like you are the first one who reads the code ;o)
Short answer: yes, you're right
Long answer:
As far as I remember the philosophy changed during coding. First it was "wait until the driver is done" for example after init and after calling exec. Then I changed the philosophy to "see if the driver is busy before giving new commands" - well ... only for the exec as I learn now. BUT ... this bug does not harm. If someone uses the feature of giving the command-buffer (as my CogOS does) the init will not wait for the driver. But even if you call an exec immediately this exec will wait. So, my fix would be: remove the repeat in init.
Comments
As the change fixes the problem I'll spend some more time to run all my test-code with this new setting to see if everything still works fine. Once I found out my password for the ObEx I also might check in a new version which gives the possibility to select FAST_CLK or SLOW_CLK - something like that.
So far tested:
all demos still work even if w500ns is set to 200
Short answer: yes, you're right
Long answer:
As far as I remember the philosophy changed during coding. First it was "wait until the driver is done" for example after init and after calling exec. Then I changed the philosophy to "see if the driver is busy before giving new commands" - well ... only for the exec as I learn now. BUT ... this bug does not harm. If someone uses the feature of giving the command-buffer (as my CogOS does) the init will not wait for the driver. But even if you call an exec immediately this exec will wait. So, my fix would be: remove the repeat in init.
Thank you again!