1 #include "../../firmware.h"
2 #include "../../test.h"
4 #define PACKET_LENGTH_32x32 128 // 1024/8
6 uint8_t packet_test_32x32[PACKET_LENGTH_32x32];
7 uint8_t packet_reference_32x32[PACKET_LENGTH_32x32];
9 #define PACKET_LENGTH_64x64 512 // 4096/8
11 uint8_t packet_test_64x64[PACKET_LENGTH_64x64];
12 uint8_t packet_reference_64x64[PACKET_LENGTH_64x64];
14 bool test_interleave(
void)
19 for(i=0; i<PACKET_LENGTH_32x32; i++)
21 packet_reference_32x32[i] = (uint8_t)(
Random(255));
22 packet_test_32x32[i] = packet_reference_32x32[i];
36 Packet_interleave_32x32(packet_test_32x32);
44 Packet_uninterleave_32x32(packet_test_32x32);
52 if(memcmp(packet_test_32x32, packet_reference_32x32, PACKET_LENGTH_32x32) != 0)
59 for(i=0; i<PACKET_LENGTH_64x64; i++)
61 packet_reference_64x64[i] = (uint8_t)(
Random(255));
62 packet_test_64x64[i] = packet_reference_64x64[i];
76 Packet_interleave_64x64(packet_test_64x64);
84 Packet_uninterleave_64x64(packet_test_64x64);
92 if(memcmp(packet_test_64x64, packet_reference_64x64, PACKET_LENGTH_64x64) == 0)
uint32_t Random(uint32_t max)
void Debug_print(char *fmt,...)
void buffer_print_bin(uint8_t *buffer, uint32_t length)