/* Compute portion of transfer within
* a single block
*/
- this_off = (uint16_t) pos & (ao_storage_unit - 1);
+ this_off = (uint16_t) (pos & (ao_storage_unit - 1));
this_len = ao_storage_unit - this_off;
if (this_len > len)
this_len = len;
/* Compute portion of transfer within
* a single block
*/
- this_off = (uint16_t) pos & (ao_storage_unit - 1);
+ this_off = (uint16_t) (pos & (ao_storage_unit - 1));
this_len = ao_storage_unit - this_off;
if (this_len > len)
this_len = len;
return 1;
}
-#ifndef AO_STORAGE_ERASED_BYTE
-#define AO_STORAGE_ERASED_BYTE 0xff
-#endif
-
uint8_t
ao_storage_is_erased(uint32_t pos)
{
uint32_t this_time = AO_STORAGE_DATA_SIZE;
if (this_time > read_len)
this_time = read_len;
- if (!ao_storage_read(read_pos, storage_data, this_time)) {
+ if (!ao_storage_read(read_pos, storage_data, (uint16_t) this_time)) {
ret = 0;
goto done;
}