Changes for running in 4bit mode

This commit is contained in:
jakeg00dwin 2024-08-23 17:06:03 -07:00
parent e7f40f795e
commit 0037bb3d9b
9 changed files with 173 additions and 51 deletions

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<executable name="dist/attiny404/debug/Relay_Tester.debug.elf">
<memory name="program">
<units>bytes</units>
<length>4096</length>
<used>486</used>
<free>3610</free>
</memory>
<memory name="data">
<units>bytes</units>
<length>256</length>
<used>2</used>
<free>254</free>
</memory>
</executable>
</project>

View File

@ -51,17 +51,17 @@ OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE}
DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE}
# Source Files Quoted if spaced # Source Files Quoted if spaced
SOURCEFILES_QUOTED_IF_SPACED=src/main.c src/RegEdit/RegEdit.c src/usart/usart.c src/timer/timer.c SOURCEFILES_QUOTED_IF_SPACED=src/main.c src/RegEdit/RegEdit.c src/usart/usart.c src/timer/timer.c src/LedController/LedController.c
# Object Files Quoted if spaced # Object Files Quoted if spaced
OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/src/main.o ${OBJECTDIR}/src/RegEdit/RegEdit.o ${OBJECTDIR}/src/usart/usart.o ${OBJECTDIR}/src/timer/timer.o OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/src/main.o ${OBJECTDIR}/src/RegEdit/RegEdit.o ${OBJECTDIR}/src/usart/usart.o ${OBJECTDIR}/src/timer/timer.o ${OBJECTDIR}/src/LedController/LedController.o
POSSIBLE_DEPFILES=${OBJECTDIR}/src/main.o.d ${OBJECTDIR}/src/RegEdit/RegEdit.o.d ${OBJECTDIR}/src/usart/usart.o.d ${OBJECTDIR}/src/timer/timer.o.d POSSIBLE_DEPFILES=${OBJECTDIR}/src/main.o.d ${OBJECTDIR}/src/RegEdit/RegEdit.o.d ${OBJECTDIR}/src/usart/usart.o.d ${OBJECTDIR}/src/timer/timer.o.d ${OBJECTDIR}/src/LedController/LedController.o.d
# Object Files # Object Files
OBJECTFILES=${OBJECTDIR}/src/main.o ${OBJECTDIR}/src/RegEdit/RegEdit.o ${OBJECTDIR}/src/usart/usart.o ${OBJECTDIR}/src/timer/timer.o OBJECTFILES=${OBJECTDIR}/src/main.o ${OBJECTDIR}/src/RegEdit/RegEdit.o ${OBJECTDIR}/src/usart/usart.o ${OBJECTDIR}/src/timer/timer.o ${OBJECTDIR}/src/LedController/LedController.o
# Source Files # Source Files
SOURCEFILES=src/main.c src/RegEdit/RegEdit.c src/usart/usart.c src/timer/timer.c SOURCEFILES=src/main.c src/RegEdit/RegEdit.c src/usart/usart.c src/timer/timer.c src/LedController/LedController.c
@ -88,54 +88,66 @@ MP_PROCESSOR_OPTION=ATtiny404
# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
# Rules for buildStep: compile # Rules for buildStep: compile
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${OBJECTDIR}/src/main.o: src/main.c .generated_files/flags/attiny404/93cd698711e08c5f098bce2b99caeb54a195d8cb .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/main.o: src/main.c .generated_files/flags/attiny404/fa73280ab5c751ec6af1e867ba2ca1963f225032 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src" @${MKDIR} "${OBJECTDIR}/src"
@${RM} ${OBJECTDIR}/src/main.o.d @${RM} ${OBJECTDIR}/src/main.o.d
@${RM} ${OBJECTDIR}/src/main.o @${RM} ${OBJECTDIR}/src/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/main.o.d" -MT "${OBJECTDIR}/src/main.o.d" -MT ${OBJECTDIR}/src/main.o -o ${OBJECTDIR}/src/main.o src/main.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/main.o.d" -MT "${OBJECTDIR}/src/main.o.d" -MT ${OBJECTDIR}/src/main.o -o ${OBJECTDIR}/src/main.o src/main.c
${OBJECTDIR}/src/RegEdit/RegEdit.o: src/RegEdit/RegEdit.c .generated_files/flags/attiny404/eaf4df5ba31e820d582cd21f0922516d83ae8266 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/RegEdit/RegEdit.o: src/RegEdit/RegEdit.c .generated_files/flags/attiny404/f1028cc7904ca5b9159231969b0f7ada47916d51 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/RegEdit" @${MKDIR} "${OBJECTDIR}/src/RegEdit"
@${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o.d @${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o.d
@${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o @${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT ${OBJECTDIR}/src/RegEdit/RegEdit.o -o ${OBJECTDIR}/src/RegEdit/RegEdit.o src/RegEdit/RegEdit.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT ${OBJECTDIR}/src/RegEdit/RegEdit.o -o ${OBJECTDIR}/src/RegEdit/RegEdit.o src/RegEdit/RegEdit.c
${OBJECTDIR}/src/usart/usart.o: src/usart/usart.c .generated_files/flags/attiny404/6cb38abd3ca230aa75430aac2df7421ff093467c .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/usart/usart.o: src/usart/usart.c .generated_files/flags/attiny404/5817417095ee90b3772093983d64af5583ba17d9 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/usart" @${MKDIR} "${OBJECTDIR}/src/usart"
@${RM} ${OBJECTDIR}/src/usart/usart.o.d @${RM} ${OBJECTDIR}/src/usart/usart.o.d
@${RM} ${OBJECTDIR}/src/usart/usart.o @${RM} ${OBJECTDIR}/src/usart/usart.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/usart/usart.o.d" -MT "${OBJECTDIR}/src/usart/usart.o.d" -MT ${OBJECTDIR}/src/usart/usart.o -o ${OBJECTDIR}/src/usart/usart.o src/usart/usart.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/usart/usart.o.d" -MT "${OBJECTDIR}/src/usart/usart.o.d" -MT ${OBJECTDIR}/src/usart/usart.o -o ${OBJECTDIR}/src/usart/usart.o src/usart/usart.c
${OBJECTDIR}/src/timer/timer.o: src/timer/timer.c .generated_files/flags/attiny404/1eddd4b60bc15f2a31507380340fe31439393a73 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/timer/timer.o: src/timer/timer.c .generated_files/flags/attiny404/531278ccb10cb2635ffd5346f85461fc0d204d43 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/timer" @${MKDIR} "${OBJECTDIR}/src/timer"
@${RM} ${OBJECTDIR}/src/timer/timer.o.d @${RM} ${OBJECTDIR}/src/timer/timer.o.d
@${RM} ${OBJECTDIR}/src/timer/timer.o @${RM} ${OBJECTDIR}/src/timer/timer.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/timer/timer.o.d" -MT "${OBJECTDIR}/src/timer/timer.o.d" -MT ${OBJECTDIR}/src/timer/timer.o -o ${OBJECTDIR}/src/timer/timer.o src/timer/timer.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/timer/timer.o.d" -MT "${OBJECTDIR}/src/timer/timer.o.d" -MT ${OBJECTDIR}/src/timer/timer.o -o ${OBJECTDIR}/src/timer/timer.o src/timer/timer.c
${OBJECTDIR}/src/LedController/LedController.o: src/LedController/LedController.c .generated_files/flags/attiny404/e5833ed4bfab6fc1888677874b82093a64e3627 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/LedController"
@${RM} ${OBJECTDIR}/src/LedController/LedController.o.d
@${RM} ${OBJECTDIR}/src/LedController/LedController.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -D__DEBUG=1 -g -DDEBUG -gdwarf-2 -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/LedController/LedController.o.d" -MT "${OBJECTDIR}/src/LedController/LedController.o.d" -MT ${OBJECTDIR}/src/LedController/LedController.o -o ${OBJECTDIR}/src/LedController/LedController.o src/LedController/LedController.c
else else
${OBJECTDIR}/src/main.o: src/main.c .generated_files/flags/attiny404/4eb85dd4799625f46dc819ca4196f7ed89fb0b7a .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/main.o: src/main.c .generated_files/flags/attiny404/5fd051d6a3fd92bb1802b9adc043a7d1f28ddda1 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src" @${MKDIR} "${OBJECTDIR}/src"
@${RM} ${OBJECTDIR}/src/main.o.d @${RM} ${OBJECTDIR}/src/main.o.d
@${RM} ${OBJECTDIR}/src/main.o @${RM} ${OBJECTDIR}/src/main.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/main.o.d" -MT "${OBJECTDIR}/src/main.o.d" -MT ${OBJECTDIR}/src/main.o -o ${OBJECTDIR}/src/main.o src/main.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/main.o.d" -MT "${OBJECTDIR}/src/main.o.d" -MT ${OBJECTDIR}/src/main.o -o ${OBJECTDIR}/src/main.o src/main.c
${OBJECTDIR}/src/RegEdit/RegEdit.o: src/RegEdit/RegEdit.c .generated_files/flags/attiny404/3023305223f3577afd127e2ae99dfa5ae0df7a9a .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/RegEdit/RegEdit.o: src/RegEdit/RegEdit.c .generated_files/flags/attiny404/165022dc8e1e49b4bb590dc119cbd48dfa74dcd .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/RegEdit" @${MKDIR} "${OBJECTDIR}/src/RegEdit"
@${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o.d @${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o.d
@${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o @${RM} ${OBJECTDIR}/src/RegEdit/RegEdit.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT ${OBJECTDIR}/src/RegEdit/RegEdit.o -o ${OBJECTDIR}/src/RegEdit/RegEdit.o src/RegEdit/RegEdit.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT "${OBJECTDIR}/src/RegEdit/RegEdit.o.d" -MT ${OBJECTDIR}/src/RegEdit/RegEdit.o -o ${OBJECTDIR}/src/RegEdit/RegEdit.o src/RegEdit/RegEdit.c
${OBJECTDIR}/src/usart/usart.o: src/usart/usart.c .generated_files/flags/attiny404/ba022f0d138ace5b4b3cc0cf32826f5ab228d78d .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/usart/usart.o: src/usart/usart.c .generated_files/flags/attiny404/adb78bad2bf6c6e7b6bc725940fdbd35cd7e6aa6 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/usart" @${MKDIR} "${OBJECTDIR}/src/usart"
@${RM} ${OBJECTDIR}/src/usart/usart.o.d @${RM} ${OBJECTDIR}/src/usart/usart.o.d
@${RM} ${OBJECTDIR}/src/usart/usart.o @${RM} ${OBJECTDIR}/src/usart/usart.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/usart/usart.o.d" -MT "${OBJECTDIR}/src/usart/usart.o.d" -MT ${OBJECTDIR}/src/usart/usart.o -o ${OBJECTDIR}/src/usart/usart.o src/usart/usart.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/usart/usart.o.d" -MT "${OBJECTDIR}/src/usart/usart.o.d" -MT ${OBJECTDIR}/src/usart/usart.o -o ${OBJECTDIR}/src/usart/usart.o src/usart/usart.c
${OBJECTDIR}/src/timer/timer.o: src/timer/timer.c .generated_files/flags/attiny404/ecf0f181a723c695620e9728e2db0edea9b71584 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709 ${OBJECTDIR}/src/timer/timer.o: src/timer/timer.c .generated_files/flags/attiny404/cc56a7bc0edc1617e859cf1cd41630662cdc0fb0 .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/timer" @${MKDIR} "${OBJECTDIR}/src/timer"
@${RM} ${OBJECTDIR}/src/timer/timer.o.d @${RM} ${OBJECTDIR}/src/timer/timer.o.d
@${RM} ${OBJECTDIR}/src/timer/timer.o @${RM} ${OBJECTDIR}/src/timer/timer.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/timer/timer.o.d" -MT "${OBJECTDIR}/src/timer/timer.o.d" -MT ${OBJECTDIR}/src/timer/timer.o -o ${OBJECTDIR}/src/timer/timer.o src/timer/timer.c ${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/timer/timer.o.d" -MT "${OBJECTDIR}/src/timer/timer.o.d" -MT ${OBJECTDIR}/src/timer/timer.o -o ${OBJECTDIR}/src/timer/timer.o src/timer/timer.c
${OBJECTDIR}/src/LedController/LedController.o: src/LedController/LedController.c .generated_files/flags/attiny404/9b6572921ed13d88d6be9b7a24c4d781ce5b16ee .generated_files/flags/attiny404/da39a3ee5e6b4b0d3255bfef95601890afd80709
@${MKDIR} "${OBJECTDIR}/src/LedController"
@${RM} ${OBJECTDIR}/src/LedController/LedController.o.d
@${RM} ${OBJECTDIR}/src/LedController/LedController.o
${MP_CC} $(MP_EXTRA_CC_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -c -x c -D__$(MP_PROCESSOR_OPTION)__ -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -DXPRJ_attiny404=$(CND_CONF) $(COMPARISON_BUILD) -gdwarf-3 -mno-const-data-in-progmem -MD -MP -MF "${OBJECTDIR}/src/LedController/LedController.o.d" -MT "${OBJECTDIR}/src/LedController/LedController.o.d" -MT ${OBJECTDIR}/src/LedController/LedController.o -o ${OBJECTDIR}/src/LedController/LedController.o src/LedController/LedController.c
endif endif
@ -156,14 +168,14 @@ endif
ifeq ($(TYPE_IMAGE), DEBUG_RUN) ifeq ($(TYPE_IMAGE), DEBUG_RUN)
${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR} @${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.map -D__DEBUG=1 -DXPRJ_attiny404=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -gdwarf-2 -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -gdwarf-3 -mno-const-data-in-progmem $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1 ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.map -D__DEBUG=1 -DXPRJ_attiny404=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -gdwarf-2 -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -gdwarf-3 -mno-const-data-in-progmem $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1
@${RM} ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.hex @${RM} ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.hex
else else
${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk
@${MKDIR} ${DISTDIR} @${MKDIR} ${DISTDIR}
${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.map -DXPRJ_attiny404=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -Wall -gdwarf-3 -mno-const-data-in-progmem $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group ${MP_CC} $(MP_EXTRA_LD_PRE) -mcpu=$(MP_PROCESSOR_OPTION) -Wl,-Map=${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.map -DXPRJ_attiny404=$(CND_CONF) -Wl,--defsym=__MPLAB_BUILD=1 -mdfp="${DFP_DIR}/xc8" -Wl,--gc-sections -O1 -ffunction-sections -fdata-sections -fshort-enums -fno-common -funsigned-char -funsigned-bitfields -I"src/RegEdit" -I"src/usart" -I"inc" -I"src/timer" -I"src/LedController" -Wall -gdwarf-3 -mno-const-data-in-progmem $(COMPARISON_BUILD) -Wl,--memorysummary,${DISTDIR}/memoryfile.xml -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} -o ${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--start-group -Wl,-lm -Wl,--end-group
${MP_CC_DIR}/avr-objcopy -O ihex "${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.hex" ${MP_CC_DIR}/avr-objcopy -O ihex "${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX}" "${DISTDIR}/Relay_Tester.${IMAGE_TYPE}.hex"
endif endif

View File

@ -1,11 +1,11 @@
# #
#Mon Aug 05 16:21:13 PDT 2024 #Thu Aug 22 12:59:17 PDT 2024
attiny404.com-microchip-mplab-mdbcore-PK5Tool-PK5ToolImpl.md5=8ed9aa4326bfc0c1a849e697826741b7 attiny404.com-microchip-mplab-mdbcore-PK5Tool-PK5ToolImpl.md5=8ed9aa4326bfc0c1a849e697826741b7
attiny404.languagetoolchain.version=2.46 attiny404.languagetoolchain.version=2.46
attiny404.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=bf89cdcdd6c0a49174fe4b605ef2b42d attiny404.com-microchip-mplab-nbide-toolchain-xc8-XC8LanguageToolchain.md5=bf89cdcdd6c0a49174fe4b605ef2b42d
conf.ids=,attiny404 conf.ids=,attiny404
host.id=2ov5-ff4p-rv host.id=2ov5-ff4p-rv
configurations-xml=3bffeb0d566f505c9074237640a84270 configurations-xml=0048f11b5d154940aa328734e33d107d
com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=f612087c95360c842296d189edfe3321
attiny404.languagetoolchain.dir=/opt/microchip/xc8/v2.46/bin attiny404.languagetoolchain.dir=/opt/microchip/xc8/v2.46/bin
proj.dir=/home/ronin/Documents/projects/freelance/laith_naaman/Relay_Tester proj.dir=/home/ronin/Documents/projects/freelance/laith_naaman/Relay_Tester

View File

@ -7,6 +7,7 @@
<itemPath>src/RegEdit/RegEdit.h</itemPath> <itemPath>src/RegEdit/RegEdit.h</itemPath>
<itemPath>src/usart/usart.h</itemPath> <itemPath>src/usart/usart.h</itemPath>
<itemPath>inc/config.h</itemPath> <itemPath>inc/config.h</itemPath>
<itemPath>src/LedController/LedController.h</itemPath>
</logicalFolder> </logicalFolder>
<logicalFolder name="ExternalFiles" <logicalFolder name="ExternalFiles"
displayName="Important Files" displayName="Important Files"
@ -24,6 +25,7 @@
<itemPath>src/RegEdit/RegEdit.c</itemPath> <itemPath>src/RegEdit/RegEdit.c</itemPath>
<itemPath>src/usart/usart.c</itemPath> <itemPath>src/usart/usart.c</itemPath>
<itemPath>src/timer/timer.c</itemPath> <itemPath>src/timer/timer.c</itemPath>
<itemPath>src/LedController/LedController.c</itemPath>
</logicalFolder> </logicalFolder>
</logicalFolder> </logicalFolder>
<sourceRootList> <sourceRootList>
@ -355,7 +357,7 @@
<property key="define-macros" value=""/> <property key="define-macros" value=""/>
<property key="disable-optimizations" value="false"/> <property key="disable-optimizations" value="false"/>
<property key="extra-include-directories" <property key="extra-include-directories"
value="src/RegEdit;src/usart;inc;src/timer"/> value="src/RegEdit;src/usart;inc;src/timer;src/LedController"/>
<property key="favor-optimization-for" value="-speed,+space"/> <property key="favor-optimization-for" value="-speed,+space"/>
<property key="garbage-collect-data" value="true"/> <property key="garbage-collect-data" value="true"/>
<property key="garbage-collect-functions" value="true"/> <property key="garbage-collect-functions" value="true"/>
@ -443,7 +445,7 @@
<property key="communication.speed" value="0.250"/> <property key="communication.speed" value="0.250"/>
<property key="debugoptions.debug-startup" value="Use system settings"/> <property key="debugoptions.debug-startup" value="Use system settings"/>
<property key="debugoptions.reset-behaviour" value="Use system settings"/> <property key="debugoptions.reset-behaviour" value="Use system settings"/>
<property key="debugoptions.useswbreakpoints" value="true"/> <property key="debugoptions.useswbreakpoints" value="false"/>
<property key="event.recorder.debugger.behavior" value="Running"/> <property key="event.recorder.debugger.behavior" value="Running"/>
<property key="event.recorder.enabled" value="false"/> <property key="event.recorder.enabled" value="false"/>
<property key="event.recorder.scvd.files" value=""/> <property key="event.recorder.scvd.files" value=""/>

View File

@ -2,6 +2,8 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group/> <group>
<file>file:/home/ronin/Documents/projects/freelance/laith_naaman/Relay_Tester/src/main.c</file>
</group>
</open-files> </open-files>
</project-private> </project-private>

View File

@ -5,7 +5,83 @@
* description: Abstract LED interface and control. * description: Abstract LED interface and control.
*/ */
#ifndef __AVR_ATtiny404__
#define __AVR_ATtiny404__
#endif
#include "LedController.h" #include "LedController.h"
#include "avr/io.h"
#define PA_B1 (1<<2)
#define PA_B2 (1<<3)
#define PA_B3 (1<<6)
#define PA_B4 (1<<7)
#define BITS_IN_BYTE (1<<2)|(1<<3)|(1<<6)|(1<<7)
#define HALF_BYTE_BM
typedef struct LedController {
void *port;
uint8_t pins[BITS_IN_BYTE];
}LedController;
static LedController controller;
void LedControler_SetPortADefault(void);
/*
* Uses pins: 9, 8, 12, 13
*/
void LedControler_SetPortBDefault(void)
{
//controller.port = &PORTA;
}
void LedController_SetLedBitNum(void * port, uint8_t pin, uint8_t bit);
void LedController_ShowByte(uint8_t byte);
void LedControler_ShowHalfByte(uint8_t byte)
{
byte = byte & 0x0F;
//PORTA.DIR |= (1<<2)|(1<<3)|(1<<6)|(1<<7);
PORTA.DIR |= PA_B1;
PORTA.DIR |= PA_B2;
PORTA.DIR |= PA_B3;
PORTA.DIR |= PA_B4;
//PORTA.DIR |= HALF_BYTE_BM;
// 15 = 0b1111
//PORTA.OUT |= (byte & 0x0F);
if(byte & 0x01){
PORTA.OUT |= PA_B1;
}
if(byte & 0x02){
PORTA.OUT |= PA_B2;
}
if(byte & 0x04){
PORTA.OUT |= PA_B3;
}
if(byte & 0x08){
PORTA.OUT |= PA_B4;
}
}
void LedControler_ClearHalfByte(void)
{
//PORTA.OUT &= HALF_BYTE_BM;
//PORTA.OUT &= ~((1<<2)|(1<<3)|(1<<6)|(1<<7));
PORTA.OUT &= ~PA_B1;
PORTA.OUT &= ~PA_B2;
PORTA.OUT &= ~PA_B3;
PORTA.OUT &= ~PA_B4;
//PORTA.OUT = 0x00;
}

View File

@ -38,5 +38,15 @@ void LedController_SetLedBitNum(void * port, uint8_t pin, uint8_t bit);
void LedController_ShowByte(uint8_t byte); void LedController_ShowByte(uint8_t byte);
/**
* Displays the the first 4 bits of a byte.
*/
void LedControler_ShowHalfByte(uint8_t byte);
/**
* Clears out the halfbyte led representation
*/
void LedControler_ClearHalfByte(void);
#endif //LEDCONTROLLER #endif //LEDCONTROLLER

View File

@ -16,6 +16,7 @@
#define __DELAY_BACKWARD_COMPATIBLE__ #define __DELAY_BACKWARD_COMPATIBLE__
#include "RegEdit.h" #include "RegEdit.h"
#include "LedController.h"
#include "config.h" #include "config.h"
#include "timer.h" #include "timer.h"
#include <avr/cpufunc.h> /* Required header file */ #include <avr/cpufunc.h> /* Required header file */
@ -25,7 +26,7 @@
#define SW1PIN (1<<5) #define SW1PIN (1<<5)
#define SW2PIN (1<<4) #define SW2PIN (1<<4)
#define RELAYPIN (1<<1) #define RELAYPIN (1<<1)
#define RELAYREADINGPIN (1<<7) //It would be better to use PA7 so USART worked #define RELAYREADINGPIN (1<<2) //It would be better to use PA7 so USART worked
//Set the function pointer for the delay func //Set the function pointer for the delay func
@ -57,26 +58,26 @@ void Deactivate_Relay(void)
void WaitForRelayConnect(void) void WaitForRelayConnect(void)
{ {
while(!(PORTA.IN & RELAYREADINGPIN)){;} while(!(PORTB.IN & RELAYREADINGPIN)){;}
} }
void WaitForRelayDisconnect(void) void WaitForRelayDisconnect(void)
{ {
while(PORTA.IN & RELAYREADINGPIN){;} while(PORTB.IN & RELAYREADINGPIN){;}
} }
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
PORTA.DIR |= RELAYPIN; PORTA.DIR |= RELAYPIN;
PORTA.DIR &= ~RELAYREADINGPIN; PORTB.DIR &= ~RELAYREADINGPIN;
PORTA.DIR &= ~SW1PIN; PORTA.DIR &= ~SW1PIN;
PORTA.DIR &= ~SW2PIN; PORTA.DIR &= ~SW2PIN;
uint16_t make_time = 0; uint16_t make_time = 0;
uint16_t break_time = 0; uint16_t break_time = 0;
uint8_t temp = 0;
while(true) { while(true) {
SW1_Wait(); SW1_Wait();
@ -88,8 +89,21 @@ int main(int argc, char **argv)
make_time = Timer_GetOverflowCount(); make_time = Timer_GetOverflowCount();
//Output the Make time via LEDS //Output the Make time via LEDS
//temp = (uint8_t)(make_time & 0x0F);
temp = 0x01;
LedControler_ShowHalfByte(temp);
_delay_ms(1000);
LedControler_ClearHalfByte();
//temp = (uint8_t)((make_time & 0xF0)>>4);
temp = 0x02;
LedControler_ShowHalfByte(temp);
_delay_ms(1000);
LedControler_ClearHalfByte();
SW2_Wait(); SW2_Wait();
Deactivate_Relay(); Deactivate_Relay();
@ -101,6 +115,22 @@ int main(int argc, char **argv)
break_time = Timer_GetOverflowCount(); break_time = Timer_GetOverflowCount();
//Output the Break time via LEDS //Output the Break time via LEDS
//temp = (uint8_t)(break_time & 0x0F);
temp = 0x04;
LedControler_ShowHalfByte(temp);
_delay_ms(1000);
LedControler_ClearHalfByte();
//temp = (uint8_t)((break_time & 0xF0)>>4);
temp = 0x08;
LedControler_ShowHalfByte(temp);
_delay_ms(1000);
LedControler_ClearHalfByte();
/* /*
USART0_sendString(maketime_msg); USART0_sendString(maketime_msg);

View File

@ -24,6 +24,13 @@ TEST_GROUP(test_LedController)
} }
}; };
TEST(test_LedController, SpyStructWorks)
{
FAIL("Not yet implimented");
}
TEST(test_LedController, FirstTest) TEST(test_LedController, FirstTest)
{ {
FAIL("Fail me!"); FAIL("Fail me!");