mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-02-07 01:11:22 +08:00
ggwave : optimize memory footprint even more
This commit is contained in:
@@ -389,6 +389,10 @@ public:
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef ARDUINO
|
||||
#include <avr/pgmspace.h>
|
||||
#endif
|
||||
|
||||
class GGWave {
|
||||
public:
|
||||
static constexpr auto kSampleRateMin = 1000.0f;
|
||||
@@ -480,22 +484,28 @@ public:
|
||||
protocols.data[i].name = nullptr;
|
||||
protocols.data[i].enabled = false;
|
||||
}
|
||||
#ifndef ARDUINO
|
||||
#define PSTR(str) (str)
|
||||
#endif
|
||||
|
||||
#ifndef GGWAVE_CONFIG_FEW_PROTOCOLS
|
||||
protocols.data[GGWAVE_PROTOCOL_AUDIBLE_NORMAL] = { "Normal", 40, 9, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_AUDIBLE_FAST] = { "Fast", 40, 6, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_AUDIBLE_FASTEST] = { "Fastest", 40, 3, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_ULTRASOUND_NORMAL] = { "[U] Normal", 320, 9, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_ULTRASOUND_FAST] = { "[U] Fast", 320, 6, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_ULTRASOUND_FASTEST] = { "[U] Fastest", 320, 3, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_DT_NORMAL] = { "[DT] Normal", 24, 9, 1, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_DT_FAST] = { "[DT] Fast", 24, 6, 1, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_DT_FASTEST] = { "[DT] Fastest", 24, 3, 1, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_AUDIBLE_NORMAL] = { PSTR("Normal"), 40, 9, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_AUDIBLE_FAST] = { PSTR("Fast"), 40, 6, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_AUDIBLE_FASTEST] = { PSTR("Fastest"), 40, 3, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_ULTRASOUND_NORMAL] = { PSTR("[U] Normal"), 320, 9, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_ULTRASOUND_FAST] = { PSTR("[U] Fast"), 320, 6, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_ULTRASOUND_FASTEST] = { PSTR("[U] Fastest"), 320, 3, 3, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_DT_NORMAL] = { PSTR("[DT] Normal"), 24, 9, 1, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_DT_FAST] = { PSTR("[DT] Fast"), 24, 6, 1, 1, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_DT_FASTEST] = { PSTR("[DT] Fastest"), 24, 3, 1, 1, true, };
|
||||
#endif
|
||||
protocols.data[GGWAVE_PROTOCOL_MT_NORMAL] = { "[MT] Normal", 24, 9, 1, 2, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_MT_FAST] = { "[MT] Fast", 24, 6, 1, 2, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_MT_FASTEST] = { "[MT] Fastest", 24, 3, 1, 2, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_MT_NORMAL] = { PSTR("[MT] Normal"), 24, 9, 1, 2, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_MT_FAST] = { PSTR("[MT] Fast"), 24, 6, 1, 2, true, };
|
||||
protocols.data[GGWAVE_PROTOCOL_MT_FASTEST] = { PSTR("[MT] Fastest"), 24, 3, 1, 2, true, };
|
||||
|
||||
#ifndef ARDUINO
|
||||
#undef PSTR
|
||||
#endif
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user