|
| 1 | +/*f |
| 2 | + * This file is part of the MicroPython project, http://micropython.org/ |
| 3 | + * |
| 4 | + * The MIT License (MIT) |
| 5 | + * |
| 6 | + * Copyright (c) 2013, 2014 Damien P. George |
| 7 | + * |
| 8 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 9 | + * of this software and associated documentation files (the "Software"), to deal |
| 10 | + * in the Software without restriction, including without limitation the rights |
| 11 | + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 12 | + * copies of the Software, and to permit persons to whom the Software is |
| 13 | + * furnished to do so, subject to the following conditions: |
| 14 | + * |
| 15 | + * The above copyright notice and this permission notice shall be included in |
| 16 | + * all copies or substantial portions of the Software. |
| 17 | + * |
| 18 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 20 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 21 | + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 22 | + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 23 | + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 24 | + * THE SOFTWARE. |
| 25 | + */ |
| 26 | +#include "supervisor/internal_flash.h" |
| 27 | + |
| 28 | +#include <stdint.h> |
| 29 | +#include <string.h> |
| 30 | + |
| 31 | +#include "extmod/vfs.h" |
| 32 | +#include "extmod/vfs_fat.h" |
| 33 | +#include "py/mphal.h" |
| 34 | +#include "py/obj.h" |
| 35 | +#include "py/runtime.h" |
| 36 | +#include "lib/oofatfs/ff.h" |
| 37 | + |
| 38 | +void supervisor_flash_init(void) { |
| 39 | +} |
| 40 | + |
| 41 | +uint32_t supervisor_flash_get_block_size(void) { |
| 42 | + return 0; |
| 43 | +} |
| 44 | + |
| 45 | +uint32_t supervisor_flash_get_block_count(void) { |
| 46 | + return 0; |
| 47 | +} |
| 48 | + |
| 49 | +void supervisor_flash_flush(void) { |
| 50 | +} |
| 51 | + |
| 52 | +static int32_t convert_block_to_flash_addr(uint32_t block) { |
| 53 | + return -1; |
| 54 | +} |
| 55 | + |
| 56 | +mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { |
| 57 | + return 0; // success |
| 58 | +} |
| 59 | + |
| 60 | +bool supervisor_flash_write_block(const uint8_t *src, uint32_t block) { |
| 61 | + return true; |
| 62 | +} |
| 63 | + |
| 64 | +mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t block_num, uint32_t num_blocks) { |
| 65 | + return 0; // success |
| 66 | +} |
| 67 | + |
| 68 | +void supervisor_flash_release_cache(void) { |
| 69 | +} |
| 70 | + |
0 commit comments