-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for SDCC and did a clean-up since it has been a long ti…
…me (close to 4 years !) - Added Keil µVision project file - Updated README.md - Added .gitignore
- Loading branch information
1 parent
28c954f
commit bf75721
Showing
5 changed files
with
522 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Listings/ | ||
Objects/ | ||
build/ | ||
*.hex | ||
*.ihx | ||
*.bin | ||
*.rel | ||
*.lst | ||
*.map | ||
*.uvgui.* | ||
*.uvopt | ||
*.pdsprj.*.workspace |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
############ Tools ######################### | ||
|
||
CC = sdcc | ||
AS = sdas8051 | ||
LD = sdld | ||
HEX_TOOL = packihx | ||
BIN_TOOL = makebin | ||
|
||
############# Project Settings ############## | ||
|
||
OUTPUT = Race_stop_watch | ||
|
||
ASM_SRCS += | ||
|
||
C_SRCS += main.c | ||
|
||
INCLUDE_PATHS += | ||
|
||
########## Compiler/Linker Flags ############ | ||
|
||
ASMFLAGS += -l -o | ||
|
||
CFLAGS += -mmcs51 -c | ||
|
||
LDFLAGS += | ||
|
||
############################################# | ||
|
||
OBJ_DIR = build | ||
|
||
C_FILES = $(notdir $(C_SRCS)) | ||
C_OBJS = $(addprefix $(OBJ_DIR)/, $(C_FILES:.c=.rel)) | ||
C_PATHS = $(sort $(dir $(C_SRCS))) | ||
vpath %.c $(C_PATHS) | ||
|
||
ASM_OBJS = $(ASM_SRCS:.asm=.rel) | ||
ASM_PATHS = $(sort $(dir $(ASM_SRCS))) | ||
vpath %.asm $(ASM_PATHS) | ||
|
||
OBJS = $(C_OBJS) $(ASM_OBJS) | ||
|
||
IHX = $(OBJ_DIR)/$(OUTPUT).ihx | ||
|
||
HEX = $(OUTPUT).hex | ||
BIN = $(OUTPUT).bin | ||
|
||
############## Make targets ################# | ||
|
||
all: $(HEX) $(IHX) $(BIN) | ||
|
||
$(BIN) : $(HEX) | ||
@echo [ BIN ] $@ | ||
@$(BIN_TOOL) -p "$<" "$@" | ||
|
||
$(HEX) : $(IHX) | ||
@echo [ HEX ] $@ | ||
@$(HEX_TOOL) "$<" > "$@" | ||
|
||
$(OBJ_DIR): | ||
@echo [ MKDIR ] $@ | ||
@mkdir "$@" | ||
|
||
$(IHX): $(OBJ_DIR) $(OBJS) | ||
@echo [ LD ] $@ | ||
@$(CC) $(LDFLAGS) -o $@ $(OBJS) | ||
|
||
$(OBJ_DIR)/%.rel: %.c | ||
@echo [ CC ] $< | ||
@$(CC) $(CFLAGS) $(addprefix -I,$(INCLUDEPATHS)) -o "$@" "$<" | ||
|
||
%.rel: %.asm | ||
@echo [ AS ] $< | ||
@$(AS) $(ASMFLAGS) $< | ||
|
||
clean: | ||
rm -rf $(OBJ_DIR) $(HEX) $(BIN) $(ASM_OBJS) *.rel *.lst *.rst | ||
|
||
|
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,5 +1,27 @@ | ||
Open race_stop_watch.pdsprj using Proteus 8. Just click play button to run the simulation. | ||
# Race Stop Watch | ||
|
||
Source code is found in main.c | ||
If you are modifying the code,compile the code and generate HEX file Keil µVision IDE (C51) | ||
Use the modified HEX file to run the simulation. | ||
Open `race_stop_watch.pdsprj` using Proteus 8. Just click play button to run the simulation. | ||
|
||
Code can be compiled with either Keil µVision IDE (C51) or SDCC | ||
- Keil µVision IDE (C51) | ||
- Download and install [Keil C51](http://www.keil.com/c51/) | ||
- Open `Race_stop_watch.uvproj` and click `Build` | ||
- SDCC | ||
- Install [SDCC](http://sdcc.sourceforge.net/) | ||
- Windows - Get [MSYS2](https://www.msys2.org/) and SDCC | ||
[32-bit installer](https://sourceforge.net/projects/sdcc/files/snapshot_builds/i586-mingw32msvc-setup/)/ | ||
[64-bit installer](https://sourceforge.net/projects/sdcc/files/snapshot_builds/x86_64-w64-mingw32-setup/) | ||
- Debian based (Eg: Ubuntu) - `sudo apt install sdcc` | ||
- macOS - `brew install sdcc` | ||
- Run `make` | ||
|
||
Use the generated HEX file `Race_stop_watch.hex` to run the Proteus simulation. | ||
|
||
![Race Stop Watch](Screenshot_Proteus_simulation.JPG) | ||
|
||
--- | ||
|
||
## Changelog | ||
|
||
- March 2016 - Initial version | ||
- December 2019 - Added support for SDCC |
Oops, something went wrong.