changes
This commit is contained in:
13
src/main.c
13
src/main.c
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#define START_GAP_MIN 1500
|
#define START_GAP_MIN 1500
|
||||||
#define ONE_WIDTH_MIN 170
|
#define ONE_WIDTH_MIN 170
|
||||||
#define ONE_WIDTH_MAX 240
|
#define ONE_WIDTH_MAX 250
|
||||||
#define ZERO_WIDTH_MIN 70
|
#define ZERO_WIDTH_MIN 70
|
||||||
#define ZERO_WIDTH_MAX 140
|
#define ZERO_WIDTH_MAX 140
|
||||||
|
|
||||||
@ -40,14 +40,15 @@ typedef struct clock_s {
|
|||||||
uint8_t year;
|
uint8_t year;
|
||||||
} clock_t;
|
} clock_t;
|
||||||
|
|
||||||
|
|
||||||
|
receivedData_t rd;
|
||||||
|
|
||||||
volatile clock_t clock;
|
volatile clock_t clock;
|
||||||
volatile uint8_t tick;
|
volatile uint8_t tick;
|
||||||
volatile uint16_t captValue = 0;
|
volatile uint16_t captValue = 0;
|
||||||
volatile uint16_t gapValue = 0;
|
volatile uint16_t gapValue = 0;
|
||||||
|
|
||||||
ISR(TIMER2_OVF_vect) {
|
ISR(TIMER2_OVF_vect) {
|
||||||
//tick = 1;
|
|
||||||
|
|
||||||
clock.second++;
|
clock.second++;
|
||||||
if (clock.second >= 60) {
|
if (clock.second >= 60) {
|
||||||
clock.second = 0;
|
clock.second = 0;
|
||||||
@ -106,7 +107,6 @@ int main() {
|
|||||||
uint8_t bit = 0;
|
uint8_t bit = 0;
|
||||||
uint8_t state = 0;
|
uint8_t state = 0;
|
||||||
|
|
||||||
receivedData_t rd;
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
if (tick != 0) {
|
if (tick != 0) {
|
||||||
@ -421,7 +421,10 @@ int main() {
|
|||||||
state++;
|
state++;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
printf("INVALID %u %u %u \n", bit, pulse, gap);
|
printf("INVALID %02d:%02d:%02d %02u.%02u.%02u %u %u %u %u \n",
|
||||||
|
clock.hour, clock.minute, clock.second,
|
||||||
|
clock.day, clock.month, clock.year, clock.weekday,
|
||||||
|
bit, pulse, gap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user