|
@@ -6,10 +6,29 @@
|
|
|
#define SHOW_DELAY 1000
|
|
|
#define KEY_DELAY 250
|
|
|
|
|
|
+const byte demoPrg[] = { 0x4F, 0x59, 0x1F, 0x29, 0x10, 0x29, 0x5A, 0x40,
|
|
|
+ 0x59, 0x64, 0x54, 0x29, 0x4F, 0x59, 0x10, 0xCD,
|
|
|
+ 0x11, 0x28, 0xCC, 0x18, 0x28, 0x4F, 0x59, 0x5A,
|
|
|
+ 0x72, 0x26, 0xC0, 0x35, 0x80, 0x90, 0xFF
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
enum PROGRAMMING_MODE {ADDRESS, COMMAND, DATA};
|
|
|
|
|
|
PROGRAMMING_MODE prgMode;
|
|
|
|
|
|
+void prgDemoPrg() {
|
|
|
+ byte value = EEPROM.read(0);
|
|
|
+ if (value == 0xFF) {
|
|
|
+ value = EEPROM.read(1);
|
|
|
+ if (value == 0xFF) {
|
|
|
+ for (byte i = 0; i < sizeof(demoPrg);i++) {
|
|
|
+ EEPROM.write(i, demoPrg[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void programMode() {
|
|
|
// checking if advance programmer board connected?
|
|
|
#ifdef SPS_ENHANCEMENT
|
|
@@ -76,7 +95,7 @@ void programMode() {
|
|
|
}
|
|
|
while (digitalRead(SW_PRG) == 1); // S2 = 1
|
|
|
delay(DEBOUNCE);
|
|
|
-
|
|
|
+
|
|
|
byte newValue = (com << 4) + data;
|
|
|
if (newValue != Eebyte) {
|
|
|
EEPROM.write(addr, newValue); // Writeeeprom Eebyte , Addr
|