renable display at hour mark
break out of cal loop
This commit is contained in:
6
CL56.cpp
6
CL56.cpp
@ -1,4 +1,5 @@
|
|||||||
#include "CL56.h"
|
#include "CL56.h"
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
|
||||||
DualCl56::DualCl56(ShiftReg<16>* shiftReg):
|
DualCl56::DualCl56(ShiftReg<16>* shiftReg):
|
||||||
_shiftReg(shiftReg)
|
_shiftReg(shiftReg)
|
||||||
@ -179,7 +180,12 @@ void DualCl56::setBlank(bool blankIn)
|
|||||||
{
|
{
|
||||||
_blank = blankIn;
|
_blank = blankIn;
|
||||||
if(_blank)
|
if(_blank)
|
||||||
|
{
|
||||||
|
cli();
|
||||||
_shiftReg->clear();
|
_shiftReg->clear();
|
||||||
|
_shiftReg->clear();
|
||||||
|
sei();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DualCl56::getBlank()
|
bool DualCl56::getBlank()
|
||||||
|
11
main.cpp
11
main.cpp
@ -528,16 +528,21 @@ int main()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(time.min == 45)
|
if(time.min == 45 && time.sec == 0)
|
||||||
display.setBlank(true);
|
display.setBlank(true);
|
||||||
|
else if(time.min == 0 && time.sec == 0)
|
||||||
|
display.setBlank(false);
|
||||||
|
|
||||||
if(time.hour == 0 && time.min == 0 && time.sec == timeOffsetSeconds+10)
|
if(time.hour == 0 && time.min == 0 && time.sec == timeOffsetSeconds+10)
|
||||||
{
|
{
|
||||||
DS1302::Timeval timeSet = time;
|
DS1302::Timeval timeSet = time;
|
||||||
timeSet.sec = 10;
|
timeSet.sec = 10;
|
||||||
clock.setTime(timeSet);
|
clock.setTime(timeSet);
|
||||||
display.setString("CAL ");
|
while(clock.getTime().sec <= timeOffsetSeconds+10)
|
||||||
_delay_ms(500);
|
{
|
||||||
|
display.setString("CAL ");
|
||||||
|
_delay_ms(500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user