-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
Baremetal Pi fix #2763
Baremetal Pi fix #2763
Conversation
const char* path = tic_fs_path(fs, name); | ||
|
||
const FsString* pathString = utf8ToString(path); | ||
#if defined(BAREMETALPI) | ||
return f_unlink(pathString); | ||
#else | ||
bool result = tic_remove(pathString); | ||
freeString(pathString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to free the string in BOTH cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed in e8ac15d.
return 0; | ||
const char* path = tic_fs_path(fs, name); | ||
const FsString* pathString = utf8ToString(path); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure you also need to free
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e8ac15d.
src/studio/fs.c
Outdated
@@ -548,8 +550,7 @@ static void onEnumPublicDirsDone(void* data) | |||
bool fs_isdir(const char* path) | |||
{ | |||
#if defined(BAREMETALPI) | |||
// This function isn't applicable to baremetal. | |||
return false; | |||
return fs_exists(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't exactly the same as "is directoy" since it's only checking for existence, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, fixed in e8ac15d.
static const char Symbols[] = " abcdefghijklmnopqrstuvwxyz0123456789-=[]\\;'`,./ "; | ||
static const char Shift[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ)!@#$%^&*(_+{}|:\"~<>? "; | ||
static const char Alt[] = " "; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the "default" (other than ES) not match the lines removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's been refactored for clarity, since the caps
boolean only reverses shift
condition, and the ternary conditional operator was already too complex even without the alt
modifier.
@@ -1827,6 +1841,7 @@ static void processShortcuts(Studio* studio) | |||
#if defined(BUILD_EDITORS) | |||
else if(studio->mode != TIC_RUN_MODE && studio->config->data.keyboardLayout != tic_layout_azerty) | |||
{ | |||
#ifndef KEYBOARD_LAYOUT_ES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would this only apply to ES layout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ES layout, ALT+1 outputs |
, ALT+2 outputs @
, and ALT+3 outputs #
. With those shortcuts in place (which can be still accessed using ESC, F1, F2, F3, etc.), there's no way to type symbols |
, @
, or #
.
Breaking work like this up into smaller commits could make it easier to review in the future. |
…i boot (avoid 4-colour screen)
Thanks for the advice. I rebuilt the commit history to make it easier to understand. |
…ents in baremetal pi
Raspberry Pi baremetal versions have been broken for a while.
I've been doing extensive testing on a recently-purchased Raspberry PI 3 (which wasn't supported by any of the existing releases, not even v0.90, unlike older Raspberry PI 3 boards, which I know should be the same hardware but it looks they're not).
I finally found that simply including the reference to
fopen
/fclose
commands in the bytebattle code instudio.c
breaks the build and makes it not go past the 4 color gradient firmware screen. Commenting out this code fixes it.There was an additional bug about
tic80
folder check always returningfalse
under baremetal. This bug was easier to find thanks to logs working again after the previous change.Additionally, the build only boots with just LUA support, so the next
cmake
command is required:More research is needed to fix the rest of languages.
Sample build rpi3-baremetal.zip. The compiler version I used is
arm-gnu-toolchain-13.2.Rel1-aarch64-arm-none-eabi
.Additional bugs that are fixed in this PR for the Baremetal version:
del
command now supports deleting files and folders..local
folder is hidden from console (simply moved to parent folder outsidetic80
).tic80.com
option is not shown, as baremetal has currently no network support.-DKEYBOARD_LAYOUT=ES
tocmake
to use it). It also requires disabling ALT+2 and ALT+3 shortcuts, as otherwise there's no way to write@
and#
symbols. Layouts for more languages can be added in the future (although they require recompiling).TIC80_KEY_BUFFER
limit).