Cleanup
This commit is contained in:
		
							
								
								
									
										5
									
								
								Config.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Config.h
									
									
									
									
									
								
							@@ -183,11 +183,6 @@
 | 
			
		||||
	uint32_t last_status_update = 0;
 | 
			
		||||
	uint32_t last_dcd = 0;
 | 
			
		||||
 | 
			
		||||
	// Status flags
 | 
			
		||||
	const uint8_t SIG_DETECT = 0x01;
 | 
			
		||||
	const uint8_t SIG_SYNCED = 0x02;
 | 
			
		||||
	const uint8_t RX_ONGOING = 0x04;
 | 
			
		||||
 | 
			
		||||
    // Power management
 | 
			
		||||
    #define BATTERY_STATE_UNKNOWN     0x00
 | 
			
		||||
    #define BATTERY_STATE_DISCHARGING 0x01
 | 
			
		||||
 
 | 
			
		||||
@@ -1371,17 +1371,12 @@ void tx_queue_handler() {
 | 
			
		||||
      else {                                                                      // Medium is free, so continue waiting
 | 
			
		||||
        if (millis() < difs_wait_start+difs_ms) { return; }                       // DIFS has not yet passed, continue waiting
 | 
			
		||||
        else {                                                                    // DIFS has passed, and we are now in CW wait
 | 
			
		||||
          digitalWrite(PIN_DIFS, LOW);
 | 
			
		||||
          if (cw_wait_start == -1) { cw_wait_start = millis(); return; }          // If we haven't started counting CW wait time, do it from now
 | 
			
		||||
          else {                                                                  // If we are already counting CW wait time, add it to the counter
 | 
			
		||||
            cw_wait_passed += millis()-cw_wait_start; cw_wait_start   = millis();
 | 
			
		||||
            if (cw_wait_passed < cw_wait_target) { return; }                      // Contention window wait time has not yet passed, continue waiting
 | 
			
		||||
            else {                                                                // Wait time has passed, flush the queue
 | 
			
		||||
              digitalWrite(PIN_FLUSH, HIGH);
 | 
			
		||||
              digitalWrite(PIN_CW, LOW);
 | 
			
		||||
              flush_queue();
 | 
			
		||||
              digitalWrite(PIN_FLUSH, LOW);
 | 
			
		||||
              digitalWrite(PIN_DIFS, LOW);
 | 
			
		||||
              cw_wait_passed = 0; csma_cw = -1; difs_wait_start = -1; }
 | 
			
		||||
 | 
			
		||||
          }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user