Skip to content

Commit 578cd84

Browse files
authored
Extend block device data types
The size of large block devices overflows when these variables are 32 bits long. For example, a 32 GB SD Card is reported as smaller than it really is.
1 parent 1f00150 commit 578cd84

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libraries/BlockDevices/BlockDevice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#define BD_ERROR_DEVICE_ERROR (-4001)
3131
#define BD_ERROR_WRITE_PROTECTED (4002)
3232

33-
typedef uint32_t bd_addr_t;
34-
typedef uint32_t bd_size_t;
33+
typedef uint64_t bd_addr_t;
34+
typedef uint64_t bd_size_t;
3535
typedef pin_size_t pin_t;
3636

3737
/* -------------------------------------------------------------------------- */
@@ -107,4 +107,4 @@ class BlockDevice {
107107
virtual const char *get_type() const = 0;
108108
};
109109

110-
#endif
110+
#endif

0 commit comments

Comments
 (0)