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
11 changes: 7 additions & 4 deletions arduino/miflo/miflo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,17 @@ bool todo_done[ 4 ] = { false, false, false, false };
char current_job_string[200] = "";

char* string2char(String s) {
static char *p;
if (s.length() != 0) {
char *p = const_cast<char*>(s.c_str());
return p;
p = const_cast<char*>(s.c_str());
} else {
*p = 0; //empty string
}
return p;
}

char* int2char(int n) {
char s[16];
static char s[16];
itoa(n, s, 10);
return s;
}
Expand Down Expand Up @@ -743,7 +746,7 @@ void show_upcoming_events() {
int x = 0;
for ( std::map<int, String>::iterator i = cache.begin(); i != cache.end(); i++ ) {
GD.cmd_text(20, 60 + x * 20, 20, 0, string2char( format_time( i->first / 10000, (i->first / 100) % 100, i->first % 100 ) ) );
GD.cmd_text(80, 60 + x * 20, 20, 0, string2char(i->second));
GD.cmd_text(80, 60 + x * 20, 20, 0, string2char( i->second ));
x++;
}

Expand Down