B4R Question ESP8266 exception if to use DelayMicroseconds

peacemaker

Expert
Licensed User
Longtime User
HI, All

Is it known trouble? Anyone seen with ESP8266?
If to replace Delay with DelayMicroseconds:
3fffff70: 3fffdad0 3ffee358 3ffee368 40201059
3fffff80: 3fffdad0 3ffee358 3ffef67c 40201638
3fffff90: feefeffe 00000000 3ffee4fc 4020199b
3fffffa0: feefeffe feefeffe feefeffe 402027dc
3fffffb0: feefeffe feefeffe 3ffe84e0 40100c9d
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------
�88�>8�>8888�8�8��8���8����>��80��8��>�>�8>�>���88>8�888>8�8�>�>�88>8�88�8888>�>8��80>�8��>�>�>8�8>8>8���>�>88>8>>>>>���>88�8>8>�����>88�8>8��8>>8�>���8�>�
AppStart
Start measurement...

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Soft WDT reset
>>>stack>>>
ctx: cont
sp: 3ffffd70 end: 3fffffc0 offset: 01a0
3fffff10: 3ffee368 00000001 00000002 401002f5
3fffff20: 401002cc 3ffee398 3ffee39c 402010e1
3fffff30: 3fffdad0 3ffee39c 3ffee398 40201724
3fffff40: 00000000 0000fffe 3ffee358 4020151d
3fffff50: 00000001 00000000 00000002 3ffee53c
3fffff60: 3fffdad0 00000000 3ffee33c 402017c8
3fffff70: 3fffdad0 3ffee358 3ffee368 40201059
3fffff80: 3fffdad0 3ffee358 3ffef67c 40201638
3fffff90: feefeffe 00000000 3ffee4fc 4020199b

Native call makes the same:
#if C
void DelayMicro (B4R::Object* o) {
   delayMicroseconds(o->toULong());
}
#End if
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
Not solved, but tricked:
B4X:
Private Sub DelayMicrosec(microseconds As UInt)
    Dim Start As ULong = Micros
    Do While True
        Dim Check As ULong = Micros
        If Check > microseconds + Start Then
            Exit
        End If
        If Check Mod 100 = 0 Then
            RunNative("yld", Null)
        End If
    Loop
End Sub

#if C
void yld(B4R::Object* o){
    yield();
}
#End If

Question is not answered...
 
Last edited:
Upvote 0
Top