mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
desktop: fixed malloc cast
This commit is contained in:
parent
3b67321945
commit
db99b664df
@ -30,7 +30,7 @@ void DataFlash_Class::Init(void)
|
|||||||
flash_fd = open("dataflash.bin", O_RDWR, 0777);
|
flash_fd = open("dataflash.bin", O_RDWR, 0777);
|
||||||
if (flash_fd == -1) {
|
if (flash_fd == -1) {
|
||||||
uint8_t *fill;
|
uint8_t *fill;
|
||||||
fill = malloc(DF_PAGE_SIZE*DF_NUM_PAGES);
|
fill = (uint8_t *)malloc(DF_PAGE_SIZE*DF_NUM_PAGES);
|
||||||
flash_fd = open("dataflash.bin", O_RDWR | O_CREAT, 0777);
|
flash_fd = open("dataflash.bin", O_RDWR | O_CREAT, 0777);
|
||||||
memset(fill, 0xFF, DF_PAGE_SIZE*DF_NUM_PAGES);
|
memset(fill, 0xFF, DF_PAGE_SIZE*DF_NUM_PAGES);
|
||||||
write(flash_fd, fill, DF_PAGE_SIZE*DF_NUM_PAGES);
|
write(flash_fd, fill, DF_PAGE_SIZE*DF_NUM_PAGES);
|
||||||
|
Loading…
Reference in New Issue
Block a user