remove unused variable
This commit is contained in:
parent
de0fef6971
commit
d2e4b81416
|
|
@ -677,7 +677,7 @@ void StartNewIteration() {
|
|||
// we send data the first time the system is started, when the array is full
|
||||
// or when the weight has fallen more than threshold or the first measurement is
|
||||
// more than one hour old (which should not happen :-) )
|
||||
if ( (next_package_is_init_package) || (my_position >= MAX_VALUES_TO_SEND) || ((last_sensor_reading.weight - current_sensor_reading.weight) > SEND_DIFF_THRESHOLD_5GRAMS) || ((millis() - timer_pos0) > 3600000)) {
|
||||
if ( (next_package_is_init_package) || (my_position >= MAX_VALUES_TO_SEND) || (abs(last_sensor_reading.weight - current_sensor_reading.weight) > SEND_DIFF_THRESHOLD_5GRAMS) || ((millis() - timer_pos0) > 3600000)) {
|
||||
lora_data.offset_last_reading = (uint8_t)((millis() - timer_pos0) / 1000 / 60);
|
||||
if (config_data.debug_level > 0) {
|
||||
gCatena.SafePrintf("startSendingUplink(), my_position: %d, iteration: %d, package_counter: %d\n", my_position, iteration, package_counter);
|
||||
|
|
@ -1023,6 +1023,7 @@ void doDeepSleep(osjob_t *pJob)
|
|||
void deepSleepPrepare(void)
|
||||
{
|
||||
Serial.end();
|
||||
Wire.endTransmission(true);
|
||||
Wire.end();
|
||||
SPI.end();
|
||||
if (fFlash)
|
||||
|
|
@ -1112,8 +1113,6 @@ static void receiveMessage(void *pContext, uint8_t port, const uint8_t *pMessage
|
|||
float fval;
|
||||
} u;
|
||||
|
||||
SENSOR_data temp_sensor_data;
|
||||
|
||||
if (config_data.debug_level > 0) {
|
||||
gCatena.SafePrintf("receiveMessage was called!!!\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ enum {
|
|||
|
|
||||
\****************************************************************************/
|
||||
|
||||
static const int32_t fwVersion = 20200525;
|
||||
static const int32_t fwVersion = 20200527;
|
||||
|
||||
static const byte INIT_PACKAGE_INTERVAL = 100; // send an init package every 100 packages;
|
||||
static const byte MAX_VALUES_TO_SEND = 8;
|
||||
|
|
@ -64,7 +64,7 @@ static const byte MAX_VALUES_TO_SEND = 8;
|
|||
static const uint8_t LORA_DATA_VERSION = 1;
|
||||
static const uint8_t LORA_DATA_VERSION_FIRST_PACKAGE = 128;
|
||||
static const uint32_t PRESSURE_OFFSET = 825;
|
||||
static const uint16_t SEND_DIFF_THRESHOLD_5GRAMS = 10; // when weight value drops by 50g, then send data
|
||||
static const uint16_t SEND_DIFF_THRESHOLD_5GRAMS = 20; // when weight changes by 100g, then send data
|
||||
static const long NOT_ATTACHED = -2147483648;
|
||||
static const byte INIT_PACKETS = 5;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void SetScalesDebugLevel(byte dbg_level)
|
|||
bool InitializeScales()
|
||||
{
|
||||
bool result;
|
||||
result &= myScale.reset(); //Reset all registers
|
||||
result = myScale.reset(); //Reset all registers
|
||||
result &= myScale.powerUp(); //Power on analog and digital sections of the scale
|
||||
|
||||
result &= myScale.setIntPolarityHigh();
|
||||
|
|
|
|||
Loading…
Reference in New Issue