mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #119 from kwagyeman/master
Fix file buffer init bug.
This commit is contained in:
commit
398eb7f95b
@ -102,6 +102,14 @@ static uint8_t *file_buffer_pointer = 0;
|
||||
static uint32_t file_buffer_size = 0;
|
||||
static uint32_t file_buffer_index = 0;
|
||||
|
||||
void file_buffer_init0()
|
||||
{
|
||||
file_buffer_offset = 0;
|
||||
file_buffer_pointer = 0;
|
||||
file_buffer_size = 0;
|
||||
file_buffer_index = 0;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE static void file_fill(FIL *fp)
|
||||
{
|
||||
if (file_buffer_index == file_buffer_size) {
|
||||
|
||||
@ -18,6 +18,8 @@ void file_read_open(FIL *fp, const char *path);
|
||||
void file_write_open(FIL *fp, const char *path);
|
||||
void file_close(FIL *fp);
|
||||
void file_seek(FIL *fp, UINT offset);
|
||||
// File buffer functions.
|
||||
void file_buffer_init0();
|
||||
void file_buffer_on(FIL *fp); // does fb_alloc_all
|
||||
uint32_t file_tell_w_buf(FIL *fp); // valid between on and off
|
||||
uint32_t file_size_w_buf(FIL *fp); // valid between on and off
|
||||
|
||||
@ -49,6 +49,7 @@
|
||||
#include "usbdbg.h"
|
||||
#include "sdram.h"
|
||||
#include "fb_alloc.h"
|
||||
#include "ff_wrapper.h"
|
||||
#include "irqs.h"
|
||||
|
||||
#include "usbd_core.h"
|
||||
@ -318,6 +319,7 @@ soft_reset:
|
||||
pyb_usb_init0();
|
||||
sensor_init0();
|
||||
fb_alloc_init0();
|
||||
file_buffer_init0();
|
||||
py_lcd_init0();
|
||||
py_fir_init0();
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user