Browse Source

HAL_AVR: tweak the default serial buffer sizes

this reduces memory fragmentation a lot, saving memory
mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
6aecdb3d7d
  1. 2
      libraries/AP_HAL_AVR/HAL_AVR_APM2_Class.cpp
  2. 5
      libraries/AP_HAL_AVR/UARTDriver.h

2
libraries/AP_HAL_AVR/HAL_AVR_APM2_Class.cpp

@ -58,7 +58,7 @@ void HAL_AVR_APM2::init(int argc, char * const argv[]) const {
/* uartA is the serial port used for the console, so lets make sure /* uartA is the serial port used for the console, so lets make sure
* it is initialized at boot */ * it is initialized at boot */
uartA->begin(115200); uartA->begin(115200, 128, 128);
console->init((void*)uartA); console->init((void*)uartA);
/* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry* /* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry*
* as the init argument */ * as the init argument */

5
libraries/AP_HAL_AVR/UARTDriver.h

@ -110,15 +110,12 @@ private:
static void _freeBuffer(Buffer *buffer); static void _freeBuffer(Buffer *buffer);
/// default receive buffer size /// default receive buffer size
static const uint16_t _default_rx_buffer_size = 128; static const uint16_t _default_rx_buffer_size = 4;
/// default transmit buffer size /// default transmit buffer size
static const uint16_t _default_tx_buffer_size = 16; static const uint16_t _default_tx_buffer_size = 16;
/// maxium tx/rx buffer size /// maxium tx/rx buffer size
/// @note if we could bring the max size down to 256, the mask and head/tail
/// pointers in the buffer could become uint8_t.
///
static const uint16_t _max_buffer_size = 256; static const uint16_t _max_buffer_size = 256;
}; };

Loading…
Cancel
Save