Close

Follow the Yellow Brick Road

A project log for Computer Motivator

If you don't know what a computer motivator is by now, then you have been reading too many textbooks and not watching enough TV.

glgormanglgorman 08/28/2021 at 04:080 Comments

 Somewhere in the build instructions for the hardware part of this project I was also discussing how I am working on fixing up a sub-dialect of the programming language LISP that i actually developed, something like 25 years or so ago, as a part of a chat bot engine.  Well, in any case - I did some updates today to the codebase which is now (at least in part) on GitHub, so this would seem like just as good of a time as any to discuss the role of LISP, in the C++ port of Propeller Debug Terminal. 

 Basically, the debug terminal responds to a set of commands that can be embedded in a text stream that ideally runs in a side channel alongside the regular printf/scanf I/O semantics that a "normal" ANSI C program might make use of when running in a terminal mode.  Hence the command set looks something like this, and that is why LISP is so nice, even if it is written in C++, because at the end of the day it would be so nice to be able to simply CONS a symbol table, and then MAPCAR the symbol table onto a list of GUI commands, so that command processing can be done by tokenizing the input stream and generating the appropriate callbacks or messages.

char *command_proc::debug_tokens[] = 
{
    "SCOPE","SCOPE_XY","SCOPE_RT","PLOT","TERM","TITLE","POS","SIZE",
    "RANGE","OFFSET","SAMPLES","TRIGGER","LABEL","COLOR","BACKCOLOR",
    "GRIDCOLOR","DOTSIZE","LOGSCALE","CLEAR","SAVE","UPDATE","LINESIZE",
    "LINECOLOR","FILLCOLOR","TO","RECT","RECTFILL","OVAL","OVALFILL",
    "POLY","POLYFILL","TEXTSIZE","TEXTCOLOR","TEXTSTYLE","TEXT",NULL
};

void command_proc::reset_debug_symbols()
{
    command_proc pdbg;
    frame &f = *(pFrame->get());
    symbol_table *t=NULL;
    t = f.cons(command_proc::debug_tokens)->sort();
    pdbg.exec(NULL1);
}

So this is a screenshot of the raw debugging stream coming from the P2 chip while running a four-channel oscilloscope program, and the hexadecimal data is oscilloscope data being streamed live.  It is just not being plotted .just yet.   Real soon now.

Discussions