Lines Matching refs:buffer
71 uint8_t *buffer; in main() local
226 buffer = calloc(tot_len(buf.st_size), 1); in main()
230 if (fread(&buffer[sizeof(uint32_t)], 1, length, file) < (size_t)length) { in main()
232 free(buffer); in main()
242 buffer[0] = type; in main()
243 buffer[1] = (length >> 16) & 0xFF; in main()
244 buffer[2] = (length >> 8) & 0xFF; in main()
245 buffer[3] = (length ) & 0xFF; in main()
246 crc = ~stm32f4_crc32(buffer, sizeof(uint32_t) + length); in main()
248 memcpy(&buffer[sizeof(uint32_t) + pad(length)], in main()
252 tot_len(length), buffer); in main()
256 length, &buffer[sizeof(uint32_t)]); in main()
264 free(buffer); in main()
277 buffer = calloc(length, 1); in main()
279 ret = read_memory(handle, address, length, buffer); in main()
281 if (fwrite(buffer, 1, length, file) < (size_t)length) in main()
289 free(buffer); in main()
301 buffer = calloc(tot_len(length), 1); in main()
303 tot_len(length), buffer); in main()
305 crc = stm32f4_crc32(buffer, tot_len(length)); in main()
306 if (fwrite(buffer, 1, tot_len(length), file) < tot_len(length)) in main()
315 free(buffer); in main()