Skip to content

Commit a8426b4

Browse files
committed
increase input buffer size and fix dictionary issue for pico
1 parent 9995497 commit a8426b4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

pico/README.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
PICO_SDK_FETCH_FROM_GIT=1 PICO_EXTRAS_FETCH_FROM_GIT=1 cmake -DCMAKE_TOOLCHAIN_FILE=../pico_arm_gcc_toolchain.cmake .. -DCMAKE_C_FLAGS="-mcpu=cortex-m0plus -mthumb" -DCMAKE_CXX_FLAGS="-mcpu=cortex-m0plus -mthumb" -DCMAKE_ASM_FLAGS="-mcpu=cortex-m0plus -mthumb"
1+
PICO_SDK_FETCH_FROM_GIT=1 PICO_EXTRAS_FETCH_FROM_GIT=1 cmake .. -DCMAKE_C_FLAGS="-mcpu=cortex-m0plus -mthumb" -DCMAKE_CXX_FLAGS="-mcpu=cortex-m0plus -mthumb" -DCMAKE_ASM_FLAGS="-mcpu=cortex-m0plus -mthumb"

pico/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void TTSstart(const char *input) {
102102
sleep_ms(100);
103103
}
104104

105-
char inbuf[128];
105+
char inbuf[2048];
106106
static int chars_rxed = 0;
107107

108108
int main() {
@@ -177,16 +177,16 @@ int main() {
177177
}
178178

179179
// Add character to buffer
180-
if (chars_rxed < 127) {
180+
if (chars_rxed < 2047) {
181181
inbuf[chars_rxed] = ch;
182182
chars_rxed++;
183183
putchar(ch); // Echo character
184184
fflush(stdout);
185185
}
186186

187187
// Handle buffer full
188-
if (chars_rxed >= 127) {
189-
inbuf[127] = '\0';
188+
if (chars_rxed >= 2047) {
189+
inbuf[2047] = '\0';
190190
printf("\n");
191191
TTSstart(inbuf);
192192
chars_rxed = 0;

src/loaddict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ int load_dictionary( void **dict_index, void **dict_data, unsigned int *dict_siz
692692
size = pointer_list_size + bytes;
693693

694694
#ifndef GBA_FIXES
695-
dict_index_buffer = (int *) &main_dict[8]; // (int *)((((QWORD)*dicMapStartAddr) + 8)); //start the index buffer at start address + 8 bytes
695+
dict_index_buffer = (long *) &main_dict[8]; // (int *)((((QWORD)*dicMapStartAddr) + 8)); //start the index buffer at start address + 8 bytes
696696
#else
697697
dict_index_buffer = (S32 *) &main_dict[8];
698698
#endif

0 commit comments

Comments
 (0)