Skip to content

Commit

Permalink
Add reliability support
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue-Crescent committed Feb 14, 2024
1 parent 661ee5f commit a0a64d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/JJYReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,19 @@ time_t JJYReceiver::get_time(uint8_t index) {
return updateTimeInfo(jjydata,index,1);
}
time_t JJYReceiver::getTime() {
time_t temp_time;
switch(state){
case INIT:
return -1;
case RECEIVE: // Intermediate update (1st receive update)
if(timeavailable == -1) return -1;
globaltime = updateTimeInfo(jjydata,timeavailable,1);
temp_time = updateTimeInfo(jjydata,timeavailable,1);
timeavailable = -1;
switch(reliability){
case 1:
return temp_time;
break;
}
return -1;
case TIMEVALID:
globaltime = updateTimeInfo(last_jjydata,0,1);
Expand Down
1 change: 1 addition & 0 deletions src/JJYReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class JJYReceiver {
volatile int8_t monitorpin = -1;
volatile uint8_t frequency = 0;
volatile uint8_t markercount = 0;
volatile uint8_t reliability = 0;
volatile uint8_t quality = 0;

volatile uint8_t tick = 0;
Expand Down

0 comments on commit a0a64d0

Please sign in to comment.