-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Changelist <!-- Give a list of the changes covered in this PR. This will help both you and the reviewer keep this PR within scope. --> Change the VC from using littlefs for CAN message logging to logfs. Tested on the VC and was seeing 5-10% CPU load while logging the entire CAN bus. Still needs more reliability testing but results looked promising so far. ### Testing Done <!-- Outline the testing that was done to demonstrate the changes are solid. This could be unit tests, integration tests, testing on the car, etc. Include relevant code snippets, screenshots, etc as needed. --> Basic testing with the car on jacks. Nothing broke obviously, but still needs more testing.
- Loading branch information
1 parent
fd15be5
commit 1de2a16
Showing
10 changed files
with
297 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
#include "io_can.h" | ||
#include "hw_sd.h" | ||
#include "lfs.h" | ||
|
||
typedef struct | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,34 @@ | ||
#include <stdint.h> | ||
#include <stddef.h> | ||
|
||
typedef enum | ||
{ | ||
FILE_OK = 0, | ||
FILE_ERROR = -1, // general error | ||
FILE_CORRUPTED = -2, // file system corrupted | ||
FILE_NOT_FOUND = -3, // file not found | ||
FILE_NO_SPACE = -4, // no space left | ||
FILE_ERROR_IO = -5, // io error | ||
FILE_OK = 0, | ||
FILE_ERROR = -1, // general error | ||
FILE_CORRUPTED = -2, // file system corrupted | ||
FILE_NOT_FOUND = -3, // file not found | ||
FILE_NO_SPACE = -4, // no space left | ||
FILE_ERROR_IO = -5, // io error | ||
FILE_ERROR_BAD_ARG = -6, // Invalid argument passed in | ||
} FileSystemError; | ||
|
||
// init the file system | ||
// config the file system | ||
// mount the file system | ||
int io_fileSystem_init(void); | ||
FileSystemError io_fileSystem_init(void); | ||
|
||
// open a file and return the file descriptor | ||
int io_fileSystem_open(const char *path); | ||
|
||
// write return error code | ||
int io_fileSystem_write(int fd, void *buf, size_t size); | ||
FileSystemError io_fileSystem_write(int fd, void *buf, size_t size); | ||
|
||
// given fd, buf, size, return error code | ||
int io_fileSystem_read(int fd, void *buf, size_t size); | ||
FileSystemError io_fileSystem_read(int fd, void *buf, size_t size); | ||
// close file | ||
int io_fileSystem_close(int fd); | ||
FileSystemError io_fileSystem_close(int fd); | ||
|
||
uint32_t io_fileSystem_getBootCount(void); | ||
|
||
// do the concrete write operation to the hardware | ||
int io_fileSystem_sync(int fd); | ||
FileSystemError io_fileSystem_sync(int fd); |
Oops, something went wrong.