remove unused variable

This commit is contained in:
Joerg Lehmann 2020-05-27 10:20:45 +02:00
parent de0fef6971
commit d2e4b81416
3 changed files with 5 additions and 6 deletions

View File

@ -677,7 +677,7 @@ void StartNewIteration() {
// we send data the first time the system is started, when the array is full // 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 // or when the weight has fallen more than threshold or the first measurement is
// more than one hour old (which should not happen :-) ) // 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); lora_data.offset_last_reading = (uint8_t)((millis() - timer_pos0) / 1000 / 60);
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("startSendingUplink(), my_position: %d, iteration: %d, package_counter: %d\n", my_position, iteration, package_counter); 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) void deepSleepPrepare(void)
{ {
Serial.end(); Serial.end();
Wire.endTransmission(true);
Wire.end(); Wire.end();
SPI.end(); SPI.end();
if (fFlash) if (fFlash)
@ -1112,8 +1113,6 @@ static void receiveMessage(void *pContext, uint8_t port, const uint8_t *pMessage
float fval; float fval;
} u; } u;
SENSOR_data temp_sensor_data;
if (config_data.debug_level > 0) { if (config_data.debug_level > 0) {
gCatena.SafePrintf("receiveMessage was called!!!\n"); gCatena.SafePrintf("receiveMessage was called!!!\n");
} }

View File

@ -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 INIT_PACKAGE_INTERVAL = 100; // send an init package every 100 packages;
static const byte MAX_VALUES_TO_SEND = 8; 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 = 1;
static const uint8_t LORA_DATA_VERSION_FIRST_PACKAGE = 128; static const uint8_t LORA_DATA_VERSION_FIRST_PACKAGE = 128;
static const uint32_t PRESSURE_OFFSET = 825; 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 long NOT_ATTACHED = -2147483648;
static const byte INIT_PACKETS = 5; static const byte INIT_PACKETS = 5;

View File

@ -24,7 +24,7 @@ void SetScalesDebugLevel(byte dbg_level)
bool InitializeScales() bool InitializeScales()
{ {
bool result; 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.powerUp(); //Power on analog and digital sections of the scale
result &= myScale.setIntPolarityHigh(); result &= myScale.setIntPolarityHigh();