Skip to content

Commit 791c2a6

Browse files
committed
network: quick beep on alarm status change
1 parent a5059c1 commit 791c2a6

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

arduino-nixie/arduino-nixie.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ int dateComp(int y, byte m, byte d, byte mt, byte dt, bool countUp); //used by n
159159
void findFnAndPageNumbers(); //used by network
160160
word getHz(byte note); //used by network (play beeper pitch sample)
161161
void signalStart(byte sigFn, byte sigDur); //used by network (play beeper pattern sample)
162+
void quickBeep(int pitch); //used by network (alarm switch change)
162163

163164
#define SHOW_IRRELEVANT_OPTIONS 0 //TODO change options to settings everywhere //for debug
164165

arduino-nixie/network.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void checkClients(){
413413
#if SHOW_IRRELEVANT_OPTIONS || ENABLE_DATE_FN
414414
client.print(F("<li><label>Current date</label><label for='curdatey'>Year&nbsp;</label><input type='number' id='curdatey' onchange='promptsave(\"curdatey\")' onkeyup='promptsave(\"curdatey\")' onblur='unpromptsave(\"curdatey\"); save(this)' min='2000' max='9999' step='1' value='")); client.print(rtcGetYear(),DEC); client.print(F("' />")); client.print(F(" <a id='curdateysave' href='#' onclick='return false' style='display: none;'>save</a>"));
415415
client.print(F("<br/><label for='curdatem'>Month&nbsp;</label><input type='number' id='curdatem' onchange='promptsave(\"curdatem\")' onkeyup='promptsave(\"curdatem\")' onblur='unpromptsave(\"curdatem\"); save(this)' min='1' max='12' step='1' value='")); client.print(rtcGetMonth(),DEC); client.print(F("' />")); client.print(F(" <a id='curdatemsave' href='#' onclick='return false' style='display: none;'>save</a>"));
416-
client.print(F("<br/><label for='curdated'>Date&nbsp;</label><input type='number' id='curdated' onchange='promptsave(\"curdated\")' onkeyup='promptsave(\"curdated\")' onblur='unpromptsave(\"curdated\"); save(this)' min='1' max='31' step='1' value='")); client.print(rtcGetDate(),DEC); client.print(F("' />")); client.print(F(" <a id='curdatedsave' href='#' onclick='return false' style='display: none;'>save</a></li>")); //TODO tip count day of year and program override to display 0 as 366 //TODO when month changes, set date max, or can you? what about 2/29? it should just do 3/1 in those cases
416+
client.print(F("<br/><label for='curdated'>Date&nbsp;</label><input type='number' id='curdated' onchange='promptsave(\"curdated\")' onkeyup='promptsave(\"curdated\")' onblur='unpromptsave(\"curdated\"); save(this)' min='1' max='31' step='1' value='")); client.print(rtcGetDate(),DEC); client.print(F("' />")); client.print(F(" <a id='curdatedsave' href='#' onclick='return false' style='display: none;'>save</a></li>"));
417417

418418
client.print(F("<li><label>Date format</label><select id='b17' onchange='save(this)'>")); for(char i=1; i<=5; i++){ client.print(F("<option value='")); client.print(i,DEC); client.print(F("'")); if(readEEPROM(17,false)==i) client.print(F(" selected")); client.print(F(">")); switch(i){
419419
case 1: client.print(F("month/date/weekday")); break;
@@ -751,7 +751,7 @@ void checkClients(){
751751
//syncfreq=min
752752
if(currentLine.startsWith(F("wssid="))){ //wifi change
753753
//e.g. wssid=Network Name&wpass=qwertyuiop&wki=1
754-
//TODO since the values are not html-entitied (due to the difficulty of de-entiting here), this will fail if the ssid contains "&wssid=" or pass contains "&wpass="
754+
//TODO since the values are not html-entitied (due to the difficulty of de-entiting here), this will fail if the ssid contains "&wpass=" or pass contains "&wki="
755755
int startPos = 6;
756756
int endPos = currentLine.indexOf(F("&wpass="),startPos);
757757
wssid = currentLine.substring(startPos,endPos);
@@ -810,11 +810,10 @@ void checkClients(){
810810
} else if(currentLine.startsWith(F("almtod"))){
811811
writeEEPROM(0,currentLine.substring(7).toInt(),true);
812812
goToFn(fnIsAlarm);
813-
} else if(currentLine.startsWith(F("alm"))){ //two settings (alarm on, alarm skip) with one control
813+
} else if(currentLine.startsWith(F("alm"))){ //two settings (alarm on, alarm skip) with one control. Compare to switchAlarm()
814814
char alm = currentLine.substring(4).toInt();
815-
if(alm<2){ writeEEPROM(2,alm,false); alarmSkip = false; }
816-
else { writeEEPROM(2,1,false); alarmSkip = true; }
817-
//TODO beeps and set fn
815+
if(alm<2){ writeEEPROM(2,alm,false); alarmSkip = false; quickBeep(alm?76:64); }
816+
else { writeEEPROM(2,1,false); alarmSkip = true; quickBeep(71); }
818817
goToFn(fnIsAlarm);
819818
} else if(currentLine.startsWith(F("runout"))){
820819
char runout = currentLine.substring(7).toInt();

0 commit comments

Comments
 (0)