fixed cb_double
parent
cb8ce33584
commit
3b75d1609b
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,21 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <PCircularBuffer.h>
|
||||
int main()
|
||||
{
|
||||
const uint16_t maxlength = 16;
|
||||
double my_buffer[maxlength];
|
||||
p_cb_double data;
|
||||
for(int ind = 0; ind < 2; ind++)
|
||||
p_cb_double_init(&data, my_buffer, 16);
|
||||
|
||||
for(int x = 0; x < 32; x++)
|
||||
{
|
||||
for(int x = 0; x < 16; x++)
|
||||
if( x < 16)
|
||||
{
|
||||
printf("[%02d] Before: %02lf\t", x, data.buffer[x]);
|
||||
data.push(&data, (double)x);
|
||||
printf("[%02d] After: %02lf\r\n", x, data.buffer[x]);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("[%02d] Before: %02lf\t", x - 16, data.buffer[x - 16]);
|
||||
data.push(&data, (double)x);
|
||||
printf("[%02d] After: %02lf\r\n", x - 16, data.buffer[x - 16]);
|
||||
}
|
||||
}
|
||||
|
||||
int x = 5;
|
||||
printf("%d\r\n", x);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue