Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

littlefs-do binary to work with spi raw file #52

Merged
merged 5 commits into from
Aug 29, 2022
Merged

Conversation

NeroBurner
Copy link
Collaborator

Add helper to modify spi raw file, to make experimenting with it easier.

$ ./littlefs-do --help
Usage: littlefs-do <command> [options]
Commands:
  -h, --help           show this help message for the selected command and exit
  stat                 show information of specified file or directory
  ls                   list available files in 'spiNorFlash.raw' file
  mkdir                create directory
  rmdir                remove directory
  rm                   remove directory or file
  cp                   copy files into or out of flash file
  settings             list settings from 'settings.h'

In the process restructure the CMake file for less duplicate
includes/defines for both executables (infinisim and littlefs-do).

Add helper to modify spi raw file, to make experimenting with it easier.

```sh
$ ./littlefs-do --help
Usage: littlefs-do <command> [options]
Commands:
  -h, --help           show this help message for the selected command and exit
  stat                 show information of specified file or directory
  ls                   list available files in 'spiNorFlash.raw' file
  mkdir                create directory
  rmdir                remove directory
  rm                   remove directory or file
  cp                   copy files into or out of flash file
  settings             list settings from 'settings.h'
```

In the process restructure the CMake file for less duplicate
includes/defines for both executables (`infinisim` and `littlefs-do`).
@JF002
Copy link
Contributor

JF002 commented Aug 22, 2022

I've just tested this feature by copying an image from my local fs to the emulated spi flash with InfiniTimeOrg/InfiniTime#1226, and it works!

image

I also find the command 'settings` quite useful:

$ ./littlefs-do settings
Calling FS::Init()
running 'settings'
calling Settings::Init()
ClockFace: 0 Digital
Chimes: 0 None
PTSColorTime: Teal
PTSColorBar: Teal
PTSColorBG: Black
AppMenu: 0
SettingsMenu: 0
ClockType: H24
NotificationStatus: 0 ON
ScreenTimeOut: 10000 ms
ShakeThreshold: 150
WakeUpModes: 
- SingleTap:  OFF
- DoubleTap:  OFF
- RaiseWrist: OFF
- Shake:      OFF
Brightness: 2 Medium
StepsGoal: 10000
BleRadioEnabled: true

I think there are a few logs that are not needed like Calling FS::Init(), running command 'stat',...

@NeroBurner
Copy link
Collaborator Author

NeroBurner commented Aug 22, 2022

Thanks for testing the littlefs-do binary.

I'll add a --verbose flag to make those messages optional, but still available for debugging

edit: happy you like the settings command, unfortunately it is high maintenance, but I like it as well :)

@NeroBurner
Copy link
Collaborator Author

done, littlefs-do is now silent per default, but can be made verbose again with -v or --verbose

@JF002
Copy link
Contributor

JF002 commented Aug 28, 2022

happy you like the settings command, unfortunately it is high maintenance, but I like it as well :)

Theoretically, it should be possible to parse the class Settings to discover the fields of the settings at build or run time. Probably not easy to do, but that would reduce the maintenance for this feature :)

@NeroBurner
Copy link
Collaborator Author

created a new issue to support a resource file installation command: #55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants