Read storage block data - Buffer to read into address - Starting address from storage size - Number of bytes to read starting from address storage_init() must be called first Returns: 0 - If range is invalid and will not fit inside a block 1 - Read was successful
| 465 | // 0 - If range is invalid and will not fit inside a block |
| 466 | // 1 - Read was successful |
| 467 | uint8_t storage_read( uint8_t* data, uint16_t address, uint16_t size ) |
| 468 | { |
| 469 | // Make sure the data section fully exists |
| 470 | if ( size + address > STORAGE_SIZE ) |
| 471 | { |
| 472 | return 0; |
| 473 | } |
| 474 | |
| 475 | // Read out from buffer |
| 476 | for ( int i = 0; i < size; i++ ) |
| 477 | { |
| 478 | data[i] = storage_buffer[address + i]; |
| 479 | } |
| 480 | return 1; |
| 481 | } |
| 482 | |
| 483 | // Read storage page position |
| 484 | // Must run storage_init() first! |
no outgoing calls
no test coverage detected
searching dependent graphs…