-
-
Notifications
You must be signed in to change notification settings - Fork 53
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
bricks/movehub: Use ERROR_REPORTING_NONE. #240
Conversation
This saves about 2.6KB without making the errors any less terse than they already were.
fa00107
to
4bf1576
Compare
If the error output is the same, what is actually being removed that saves so much size? |
Presumeably code with message handling now skipping that, but I'll definitely dig deeper before merging. #if MICROPY_ERROR_REPORTING == MICROPY_ERROR_REPORTING_NONE
#define mp_obj_new_exception_msg(exc_type, msg) mp_obj_new_exception(exc_type)
#define mp_obj_new_exception_msg_varg(exc_type, ...) mp_obj_new_exception(exc_type)
|
This makes it consistent with the build option. The previous commit saved a large amount of space, despite accidentally bringing back the verbose Pybricks error messages.
But I wasn't quite right about the savings, since the some of our own modules check for Now it saves about 4KB. |
@BertLindeman , @JorgePe, would you be interested to try out this firmware to see if anything major is missing or broken? If we really saved 4KB, we should be able to keep your move hubs going for quite a long time 馃槃 The download links are shown in the posts above. |
--- forget it, i read the whole text --- I sure can - I was just flashing another Move Hub for my snake. Is it available with Beta IDE or do I need to download it? |
Thanks! I was hoping the weekend was just the right time 馃槃 Please use the download link above. In Pybricks, begin the firmware update as usual, but instead of selecting the move hub, choose Advanced at the bottom and select the zip you just downloaded. It doesn't matter if you do this in Pybricks beta or stable. Things to look out for would be unexpected errors, or maybe missing errors. Or any form of unexpected behaviors, such as things continuing when there should have been an exception. |
will do, Laurens |
Looks good to me. Tested Broadcasting (just observe), internal LED color and the 2 internal motors in multitask. |
OK by me too, tested broadcast, observe, various import, name and other errors.
The compiler reports:
|
There is some loss in verbosity. raise OSError("hi")
1/0
from pybricks import nothing
|
But I don't think the |
Thanks @BertLindeman ! |
Awesome, thank you! |
This saves about 2.6KB without making the errors any less terse than they already were.
馃く
For example
will still give the slightly more unhelpful error:
So no great loss. I dug into this when adding a call to
raise_msg
, which added a bit too much build size for something that isn't supposed to do much.