Skip to content

Commit

Permalink
Merge pull request #3 from Blue-Crescent/progress
Browse files Browse the repository at this point in the history
power down
  • Loading branch information
Blue-Crescent authored Feb 12, 2024
2 parents 41f6979 + 1f59dbf commit c6a01d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/JJYReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ JJYReceiver::JJYReceiver(int pindata,int pinsel,int pinpon) :
pinMode(pindata, INPUT);
pinMode(pinsel, OUTPUT);
pinMode(pinpon, OUTPUT);


}
JJYReceiver::JJYReceiver(int pindata,int pinpon):
datapin(pindata),selpin(-1),ponpin(pinpon){
Expand Down Expand Up @@ -87,7 +85,9 @@ bool JJYReceiver::timeCheck(){
min1 == min2)
{
last_jjydata = jjydata[compare[i][1]];
timeavailable[compare[i][1]] = 1;
state = TIMEVALID;
stop();
return true;
}
}
Expand Down Expand Up @@ -274,7 +274,6 @@ void JJYReceiver::begin(){
}

void JJYReceiver::stop(){
state = TIMEVALID;
power(false);
}

Expand Down
3 changes: 3 additions & 0 deletions src/JJYReceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ 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 @@ -80,6 +81,7 @@ class JJYReceiver {

volatile uint8_t sampleindex = 0;
volatile uint8_t sampling [N];
volatile uint8_t timeavailable [N];
volatile const uint8_t CONST_PM [N] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00};
volatile const uint8_t CONST_H [N] = {0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
volatile const uint8_t CONST_L [N] = {0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
Expand Down Expand Up @@ -135,6 +137,7 @@ class JJYReceiver {
void init(){
state = RECEIVE;
clear(sampling,N);
clear(timeavailable,3);
jjydata[0].bits.hour = 25;
jjydata[1].bits.hour = 26;
jjydata[2].bits.hour = 27;
Expand Down

0 comments on commit c6a01d6

Please sign in to comment.