Main .ino file:
#include "bluevmega.cpp"
void setup()
{
Serial.begin(57600);
delay(1000);
}
void loop()
{
hwsetup(); [b]// GLOW: added beacuse I've renamed init() into hwsetup() !!!!!!!!!!!![/b]
int ret;
unsigned char lastdisp[12];
Serial.println("V1MegaTool");
for (;;) {
for (;;) {
ret = readpkt(respget); [b]// FX: STAY BLOCKED HERE !!! (GLOW)[/b]
if (ret < 5)
continue;
if (respget[3] == INFDISPLAYDATA)
break;
}
if(legacy > 32)
printser(pullp(PSTR("LEGACY! only V works\r\n")));
inbuf[inhead++] = Serial.read();
printser(pullp(PSTR("Mute (ESP)Hold systemUp mainDisp Euro Custom\r\n")));
lastdisp[0] = 0;
while (1) {
ret = readpkt(respget);
if (ret < 5) {
continue;
}
if (respget[3] == INFDISPLAYDATA && memcmp(lastdisp, respget, 12)) {
showinfdisp();
memcpy(lastdisp, respget, 12);
}
if (Serial.available() >= 1 ) {
inbuf[inhead++] = Serial.read();
}
}
break;
}
}