Mobsya / aseba-target-thymio2

Thymio 2 firmware
8 stars 8 forks source link

Add a reset native function #10

Closed stephanemagnenat closed 8 years ago

stephanemagnenat commented 8 years ago

@motib has suggested to add a reset output native function doing the followings:

call sound.system(-1)
call leds.top(0,0,0)
call leds.bottom.left(0,0,0)
call leds.bottom.right(0,0,0)
call leds.circle(0,0,0,0,0,0,0,0)

In addition, I suggest that, if implemented, such a function resets the IR communication (see issues #8 and #9). Technically, there might be an internal function called both from the initialization code and from the proposed native function.

mbonani commented 8 years ago

call sound system(-1) should not be in this reset. It is used to mute normal system sound when we press buttons. It was implement in VPL to not make mistake using the micro card. OK for the others.

mbonani commented 8 years ago

Another point to discuss is also what to do with internal "behvior" like the blowing of the leds from IR sensors. One time you use the "call leds.ir.prox(.. )" it stop the blowing behavior. Should we reinitialize it in this reset? It the same for system sounds.

stephanemagnenat commented 8 years ago

Your last point is interesting. Yes I suggest that the reset also re-initialize these to the startup behaviour.

mbonani commented 8 years ago

implement in commit 02a640d

mbonani commented 8 years ago

finally this function is not need with the clean VM when loading or reseting please close this issue