RTL/NCURSES - Clear Queue and Dibit Buffer; #125

This commit is contained in:
lwvmobile
2023-05-21 20:19:56 -04:00
parent 5c8e3d95a7
commit 6a0b1b2dcf
6 changed files with 40 additions and 7 deletions

View File

@@ -120,3 +120,15 @@ void resetState (dsd_state * state)
initialize_p25_heuristics(&state->p25_heuristics);
initialize_p25_heuristics(&state->inv_p25_heuristics);
}
//simple function to reset the dibit buffer
void reset_dibit_buffer(dsd_state * state)
{
//Dibit Buffer -- Free Allocated Memory
free (state->dibit_buf);
//Dibit Buffer -- Memset/Init/Allocate Memory
state->dibit_buf = malloc (sizeof (int) * 1000000);
state->dibit_buf_p = state->dibit_buf + 200;
memset (state->dibit_buf, 0, sizeof (int) * 200);
}