An utility to make C51 recognize binary literals such as 0b10010010
.
Please read this README from beginning to end.
IF YOU DO NOT UNDERSTAND WHAT YOU ARE DOING , PLEASE STOP!
THIS SOFTWARE IS PROVIDED "AS-IS" , WITHOUT ANY EXPRESSED OR IMPLIED WARRANTY .USE IT AT YOUR OWN RISK !
- Open Keil uVision.
- Get to your project.
- Open the option window of your target.
- Get to the
User
tab. - Edit it .(Follow the picture below)
It's okey if your binpp.exe isn't stored under your project directory.
-
In the
Before Build/Rebuild
Tab add your source file name to the arguments of the binpp.exe -
Set the error code to <0
-
Have Fun !
-
If the Build fails , the source files won't be restored automatically.
- You need to manually execute
binpp.exe restore YOUR_PROJECT_DIRECTORY
to restore your source files. - Pro Tip : ( There's a easier way. )
- Open Keil uVision.
- Click
Tools
Menu and then clickCustomize Tool Menu...
- Insert a new menu item and name it to
Restore Files
. ( Or anything you want. ) - Set the command to the path of your
binpp
executable . - Leave the
Initial Folder
Empty - Click
OK
. - Now you can restore your project files easily simply by clicking
Tools > Restore Files
- You need to manually execute
- uVision may show dialogs such that the source files are changed outside it.(No Fix)
- Binary literals inside comments,function names , etc (except string literals) will be replaced with hex literals .(I won't fix this , but PR are welcomed)
- Source files won't auto restore if the C51 compiler (or other components of the toolchain) fails.
binpp FILES_LIST # Process files and make backups
binpp restore # Recursively restore all directories under working directory.
binpp # The same as above
binpp restore FILES_OR_DIRECTORIES_LIST # restore files and recusively restore directories
Read the source code thoroughly and you can know how it works!