Update debug.cpp

Added TTY event callback