Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions src/escom.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// Save the resulting executive in a directory that is in your %PATH% for easy access. *
// Written by Ed Smallenburg. *
// Todo: *
// - Now, targets "stm8ef" and "mecrisp" are supported. Add other platforms. *
// - Now, targets "stm8ef", "mecrisp", and "zepto" are supported. Add other platforms. *
//***************************************************************************************************
// Command line options: *
// -t xxxx -- Target system, "stm8ef" and "mecrisp" are currently supported. *
// -t xxxx -- Target system, "stm8ef", "mecrisp", and "zepto" are currently supported. *
// -d xxxx -- Communication device, for example "COM5". *
// -b xxxx -- Baudrate for communication, for example 115200. *
// -p xxxx -- Search path for #include, #require and \res files. *
Expand Down Expand Up @@ -544,6 +544,28 @@ char* check_ok_mecrisp ( char* buf )
}


//***************************************************************************************************
// C H E C K _ O K _ S T M 8 E *
//***************************************************************************************************
// Check for "ok\r\n" at the end of the line. *
// Version for zepto. *
//***************************************************************************************************
char* check_ok_zepto ( char* buf )
{
char* res ; // Function result

res = buf += strlen ( buf ) - 4 ; // Points to end of string - 3
if ( ( *buf++ != 'o' ) || // Ends with "ok"?
( *buf++ != 'k' ) ||
( *buf++ != '\r' ) ||
( *buf != '\n' ) )
{
res = NULL ; // Not expected end
}
return res ;
}


//***************************************************************************************************
// B E A U T I F Y *
//***************************************************************************************************
Expand Down Expand Up @@ -1104,6 +1126,10 @@ void set_target_specials()
{
ok_chk = &check_ok_mecrisp ; // Yes, use mecrist version
}
if ( strcasecmp ( target, "zepto" ) == 0 ) // Target is "zepto" ?
{
ok_chk = &check_ok_zepto ; // Yes, use zeptoforth version
}
}


Expand Down