Skip to content

Commit

Permalink
不要部分削除
Browse files Browse the repository at this point in the history
  • Loading branch information
Blue-Crescent committed Feb 14, 2024
1 parent e262645 commit 0510c31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/JJYReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ void JJYReceiver::shift_in(uint8_t data,volatile uint8_t* sampling, int length){
}

bool JJYReceiver::timeCheck(){
int compare[3][2] = {{0, 1}, {0, 2}, {1, 2} };
int compare[6][2] = {{0, 1}, {0, 2}, {1, 0}, {1, 2}, {2, 0}, {2, 1}};
uint8_t min1,min2;
for (int i = 0; i < 3; i++) {
for (int i = 0; i < 6; i++) {
min1 = ((jjydata[compare[i][0]].bits.min >> 5) & 0x7) * 10 + (jjydata[compare[i][0]].bits.min & 0x0f) + 1;
min2 = ((jjydata[compare[i][1]].bits.min >> 5) & 0x7) * 10 + (jjydata[compare[i][1]].bits.min & 0x0f) + 2;
if (jjydata[compare[i][0]].bits.year == jjydata[compare[i][1]].bits.year &&
Expand Down
6 changes: 1 addition & 5 deletions src/JJYReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ typedef union {

class JJYReceiver {
enum STATE {INIT,RECEIVE,TIMEVALID,TIMETICK};
enum RCVSTATE {NONE=0,TIMEVALID0,TIMEVALID1,TIMEVALID2};
enum JJYSTATE {JJY_INIT=-1,JJY_MIN=0,JJY_HOUR=1,JJY_DOYH=2,JJY_DOYL=3,JJY_YEAR=4,JJY_WEEK=5};

public:
Expand All @@ -94,7 +93,6 @@ 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 Expand Up @@ -133,7 +131,6 @@ class JJYReceiver {
int max_of_three(uint8_t a, uint8_t b, uint8_t c);
bool calculateParity(uint8_t value, uint8_t bitLength, uint8_t expectedParity);
bool timeCheck();
//time_t updateTimeInfo(JJYData jjydata*, int8_t index, int8_t offset);
time_t getTime();
time_t get_time();
time_t get_time(uint8_t index);
Expand Down Expand Up @@ -165,8 +162,7 @@ class JJYReceiver {
calculateDate(year, yday ,(uint8_t*) &timeinfo.tm_mon,(uint8_t*) &timeinfo.tm_mday);
timeinfo.tm_hour = ((jjydata[index].bits.hour >> 5) & 0x3) * 10 + (jjydata[index].bits.hour & 0x0f) ; //
timeinfo.tm_min = ((jjydata[index].bits.min >> 5) & 0x7) * 10 + (jjydata[index].bits.min & 0x0f) + offset; //
time_t temp = mktime(&timeinfo);
return temp;
return mktime(&timeinfo);
}
void init(){
state = RECEIVE;
Expand Down

0 comments on commit 0510c31

Please sign in to comment.