View Full Version : v2.2.14, known issues and @setHook(HOOK_STDOUT)
icowie
10-22-2009, 02:31 PM
I am working with 2.2.14 firmware, and am having trouble with @setHook(HOOK_STDOUT), which doesn't seem to execute at all, when any print to the standard output completes. The @setHook(HOOK_STDIN) works fine. No example of the usage of the STDOUT hook is listed in the reference manual.
Additionally, are there any known bugs and/or workarounds, that may save some debug time, in advance?
Thank you very much.
mgenti
10-22-2009, 06:26 PM
I just tried this test script that I came up with:
from synapse.switchboard import *
LED_PIN = 0
@setHook(HOOK_STDOUT)
def on_stdout():
writePin(LED_PIN, False)
def test():
writePin(LED_PIN, True)
print "This is a string that I want to output"
@setHook(HOOK_STARTUP)
def on_startup():
setPinDir(LED_PIN, True)
crossConnect(DS_STDIO, DS_UART0)
initUart(0, 1200)
flowControl(0, False)
If you load this into your unit you should see the LED come on when you call the test function and then the LED turn off when the STDOUT hook is called.
At this time there is no know errata for SNAP 2.2.14
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.