-
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.
Seven segment display working, refactoring
- Loading branch information
Showing
11 changed files
with
106 additions
and
16 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
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,3 +1,5 @@ | ||
* Get basic data on segmented display | ||
* Seven segment display improvements | ||
- No leading zeros | ||
- ifndefs to optionally remove 4 digit support | ||
** Further modularize build/files | ||
*** Logging? |
Binary file not shown.
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,25 @@ | ||
/* | ||
* filename: embmath.c | ||
* date: 04.29.24 | ||
* author: Lucas Merritt/merrittlj | ||
* description: Implementation for embmath.h. | ||
*/ | ||
|
||
#include "embmath.h" | ||
|
||
|
||
int ipow(int base, int exp) | ||
{ | ||
int result = 1; | ||
for (;;) | ||
{ | ||
if (exp & 1) | ||
result *= base; | ||
exp >>= 1; | ||
if (!exp) | ||
break; | ||
base *= base; | ||
} | ||
|
||
return result; | ||
} |
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,16 @@ | ||
/* | ||
* filename: embmath.h | ||
* date: 04.29.24 | ||
* author: Lucas Merritt/merrittlj | ||
* description: Small math functions for embedded systems. | ||
*/ | ||
|
||
#ifndef EMBMATH_H | ||
#define EMBMATH_H | ||
|
||
#include "common.h" | ||
|
||
|
||
extern int ipow(int base, int exp); | ||
|
||
#endif |
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,19 @@ | ||
LIB = $(MAKE_DIR)/libs/libembmath.a | ||
SRCS = $(wildcard *.c) | ||
OBJS = $(patsubst %.c, %.o, $(SRCS)) | ||
|
||
$(LIB): $(OBJS) | ||
@mkdir -p $(MAKE_DIR)/libs | ||
@$(AR) cr $@ $^ | ||
@echo "Archive $(notdir $@)" | ||
|
||
%.o: %.c | ||
@$(CC) $(CFLAGS) -c $^ -o $@ | ||
@echo "CC $@" | ||
|
||
clean: | ||
@$(RM) -f $(LIB) $(OBJS) | ||
@$(RM) -f *.expand | ||
@echo "Remove objects: $(OBJS)" | ||
|
||
.PHONY = clean |
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
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
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
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
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