File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 29
29
#include <nuttx/mtd/mtd.h>
30
30
#include <nuttx/version.h>
31
31
32
+ #include <endian.h>
32
33
#include <errno.h>
33
34
#include <fcntl.h>
34
35
#include <inttypes.h>
72
73
#define FASTBOOT_SPARSE_HEADER sizeof(struct fastboot_sparse_header_s)
73
74
#define FASTBOOT_CHUNK_HEADER sizeof(struct fastboot_chunk_header_s)
74
75
75
- #define FASTBOOT_GETUINT32 (p ) (((uint32_t)(p)[3] << 24) | \
76
- ((uint32_t)(p)[2] << 16) | \
77
- ((uint32_t)(p)[1] << 8) | \
78
- (uint32_t)(p)[0])
79
-
80
76
#define fb_info (...) syslog(LOG_INFO, ##__VA_ARGS__);
81
77
#define fb_err (...) syslog(LOG_ERR, ##__VA_ARGS__);
82
78
@@ -437,7 +433,7 @@ fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd)
437
433
break ;
438
434
case FASTBOOT_CHUNK_FILL :
439
435
{
440
- uint32_t fill_data = FASTBOOT_GETUINT32 ( chunk_ptr );
436
+ uint32_t fill_data = be32toh ( * ( FAR uint32_t * ) chunk_ptr );
441
437
uint32_t chunk_size = chunk -> chunk_sz * sparse -> blk_sz ;
442
438
ret = ffastboot_flash_fill (fd , context -> download_offset ,
443
439
fill_data , sparse -> blk_sz ,
You can’t perform that action at this time.
0 commit comments