Save memory (move usb mass storage buffer to reusableBuffer) (#5579)
* Save 128 byte by moving variable to stack * Make usb mass storage buffer smaller on F2 processors and put into reuseablebuffer - Lower USB mass storage buffer to 512 bytes per default on F2 targets, makes usb speed slightly slower ~600 kB/s instead ~700 KB/s in my tests, saving 3584 bytes - Save another ~300 bytes by putting that buffer into reusableBuffer * Don't put id into reusuableBuffer All uses of id can be on the stack as well. Makes no difference for ram usage but makes it safer to reuse reusableBuffer * Only link cdc serial when needed We always linked usb cdc even in non debug builds. CDC uses about ~600 byte of RAM for its buffers and structures.
This commit is contained in:
committed by
Bertrand Songis
parent
95df593c2f
commit
4925e756a6
+8
-6
@@ -27,6 +27,9 @@
|
||||
#include <stdlib.h>
|
||||
#include "definitions.h"
|
||||
#include "opentx_types.h"
|
||||
#if defined(STM32)
|
||||
#include "usbd_conf.h"
|
||||
#endif
|
||||
|
||||
#if defined(SIMU)
|
||||
#define SWITCH_SIMU(a, b) (a)
|
||||
@@ -1495,16 +1498,15 @@ union ReusableBuffer
|
||||
} sdmanager;
|
||||
#endif
|
||||
|
||||
#if defined(STM32)
|
||||
struct
|
||||
{
|
||||
char id[27];
|
||||
} version;
|
||||
#endif
|
||||
struct
|
||||
{
|
||||
uint8_t stickMode;
|
||||
} generalSettings;
|
||||
|
||||
#if defined(STM32)
|
||||
// Data for the USB mass storage driver. If USB mass storage runs no menu is not allowed to be displayed
|
||||
uint8_t MSC_BOT_Data[MSC_MEDIA_PACKET];
|
||||
#endif
|
||||
};
|
||||
|
||||
extern union ReusableBuffer reusableBuffer;
|
||||
|
||||
Reference in New Issue
Block a user