# HG changeset patch # User Matt Johnston # Date 1339808920 -28800 # Node ID aa247177837ac600c000cf7795325fa63e1a0125 # Parent ccab04e2f6015bb8e0509e9f437aed9cf87851a3# Parent ba9bfcc9c5260bb733f19b659e26a4373e4eb939 merge diff -r ba9bfcc9c526 -r aa247177837a main.c --- a/main.c Sat Jun 16 09:03:15 2012 +0800 +++ b/main.c Sat Jun 16 09:08:40 2012 +0800 @@ -30,7 +30,7 @@ // 1 second. we have 1024 prescaler, 32768 crystal. #define SLEEP_COMPARE 32 // limited to uint16_t -#define MEASURE_WAKE 300 +#define MEASURE_WAKE 20 #define VALUE_NOSENSOR -9000 #define VALUE_BROKEN -8000 @@ -234,11 +234,11 @@ fprintf_P(crc_stdout, PSTR("START\n")); fprintf_P(crc_stdout, PSTR("now=%lu\n" - "time_step=%lu\n" + "time_step=%hu\n" "first_time=%lu\n" "last_time=%lu\n"), clock_epoch, - MEASURE_WAKE, + (uint16_t)MEASURE_WAKE, first_measurement_clock, last_measurement_clock); fprintf_P(crc_stdout, PSTR("sensors=%u\n"), n_sensors); @@ -250,13 +250,13 @@ printhex(id, ID_LEN, crc_stdout); fputc('\n', crc_stdout); } - fprintf_P(crc_stdout, PSTR("measurements=%u\n"), n_measurements); + fprintf_P(crc_stdout, PSTR("measurements=%hu\n"), n_measurements); for (uint16_t n = 0; n < n_measurements; n++) { fprintf_P(crc_stdout, PSTR("meas%u="), n); for (uint8_t s = 0; s < n_sensors; s++) { - fprintf_P(crc_stdout, PSTR(" %u"), measurements[n][s]); + fprintf_P(crc_stdout, PSTR(" %hu"), measurements[n][s]); } fputc('\n', crc_stdout); } @@ -519,7 +519,8 @@ if (comms_timeout != 0) { - comms_timeout--; + // XXX testing + //comms_timeout--; } if (measure_count >= MEASURE_WAKE) @@ -750,6 +751,7 @@ sei(); need_comms = 1; + need_measurement = 1; #if 0 for (;;)