Skip to content

Commit

Permalink
Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Dec 8, 2023
1 parent 6beefb3 commit ff92e4a
Show file tree
Hide file tree
Showing 15 changed files with 202 additions and 90 deletions.
115 changes: 69 additions & 46 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 34 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ ENABLE_REDUCE_LOW_MID_TX_POWER:= 0
ENABLE_BYP_RAW_DEMODULATORS := 0
ENABLE_BLMIN_TMP_OFF := 0
ENABLE_SCAN_RANGES := 1
TEST_UNDE_CTCSS := 1
ENABLE_MDC1200 := 1
ENABLE_MDC1200_SHOW_OP_ARG := 1
ENABLE_MDC1200_SIDE_BEEP := 0

# ---- DEBUGGING ----
ENABLE_AM_FIX_SHOW_DATA := 0
ENABLE_AGC_SHOW_DATA := 0
ENABLE_MDC1200 := 1
ENABLE_MDC1200_SHOW_OP_ARG := 0
ENABLE_MDC1200_SIDE_BEEP := 0

#############################################################

TARGET = firmware
Expand All @@ -79,6 +79,9 @@ ifeq ($(ENABLE_OVERLAY),1)
OBJS += sram-overlay.o
endif
OBJS += external/printf/printf.o
ifeq ($(ENABLE_MDC1200),1)
OBJS += app/mdc1200.o
endif

# Drivers
OBJS += driver/adc.o
Expand Down Expand Up @@ -107,9 +110,7 @@ OBJS += driver/systick.o
ifeq ($(ENABLE_UART),1)
OBJS += driver/uart.o
endif
ifeq ($(ENABLE_MDC1200),1)
OBJS += app/mdc1200.o
endif

# Main
OBJS += app/action.o
ifeq ($(ENABLE_AIRCOPY),1)
Expand Down Expand Up @@ -179,7 +180,7 @@ else
endif

ifdef OS # windows
RM = del /Q
RM = del
FixPath = $(subst /,\,$1)
WHERE = where
NULL_OUTPUT = nul
Expand Down Expand Up @@ -209,7 +210,7 @@ endif
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size

AUTHOR_STRING := LOSEHU
AUTHOR_STRING := EGZUMER
# the user might not have/want git installed
# can set own version string here (max 7 chars)
ifneq (, $(shell $(WHERE) git))
Expand Down Expand Up @@ -258,6 +259,16 @@ CFLAGS += -DAUTHOR_STRING=\"$(AUTHOR_STRING)\" -DVERSION_STRING=\"$(VERSION_STRI
ifeq ($(ENABLE_SPECTRUM),1)
CFLAGS += -DENABLE_SPECTRUM
endif
ifeq ($(ENABLE_MDC1200),1)
CFLAGS += -DENABLE_MDC1200
endif
ifeq ($(ENABLE_MDC1200_SHOW_OP_ARG),1)
CFLAGS += -DENABLE_MDC1200_SHOW_OP_ARG
endif
ifeq ($(ENABLE_MDC1200_SIDE_BEEP),1)
CFLAGS += -DENABLE_MDC1200_SIDE_BEEP
endif

ifeq ($(ENABLE_SWD),1)
CFLAGS += -DENABLE_SWD
endif
Expand Down Expand Up @@ -375,15 +386,7 @@ endif
ifeq ($(ENABLE_FLASHLIGHT),1)
CFLAGS += -DENABLE_FLASHLIGHT
endif
ifeq ($(ENABLE_MDC1200),1)
CFLAGS += -DENABLE_MDC1200
endif
ifeq ($(ENABLE_MDC1200_SHOW_OP_ARG),1)
CFLAGS += -DENABLE_MDC1200_SHOW_OP_ARG
endif
ifeq ($(ENABLE_MDC1200_SIDE_BEEP),1)
CFLAGS += -DENABLE_MDC1200_SIDE_BEEP
endif

LDFLAGS =
LDFLAGS += -z noexecstack -mcpu=cortex-m0 -nostartfiles -Wl,-T,firmware.ld -Wl,--gc-sections

Expand Down Expand Up @@ -430,7 +433,7 @@ else ifneq (,$(HAS_CRCMOD))
$(info !!!!!!!! run: pip install crcmod)
$(info )
else
-$(MY_PYTHON) fw-pack.py $<.bin $(AUTHOR_STRING) $<.packed.bin
-$(MY_PYTHON) fw-pack.py $<.bin $(AUTHOR_STRING) $(VERSION_STRING) $<.packed.bin
endif

$(SIZE) $<
Expand Down Expand Up @@ -458,5 +461,15 @@ bsp/dp32g030/%.h: hardware/dp32g030/%.def

-include $(DEPS)

clean:
$(RM) $(call FixPath, $(TARGET).bin $(TARGET).packed.bin $(TARGET) $(OBJS) $(DEPS))
ifdef OS
ifeq ($(OS),Windows_NT)
clean:
.\clean.bat
else
clean:
$(RM) $(call FixPath, $(TARGET).bin $(TARGET).packed.bin $(TARGET) $(OBJS) $(DEPS))
endif
else
clean:
@echo "Unsupported OS. Please use this Makefile on Windows or Linux."
endif
13 changes: 7 additions & 6 deletions am_fix.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "app/main.h"
#include "board.h"
#include "driver/bk4819.h"
#include "external/printf/printf.h"
//#include "external/printf/printf.h"
#include "frequencies.h"
#include "functions.h"
#include "misc.h"
Expand Down Expand Up @@ -303,23 +303,24 @@ void AM_fix_reset(const unsigned vfo)
// won't/don't do it for itself, we're left to bodging it ourself by
// playing with the RF front end gain setting
//
void AM_fix_10ms(const unsigned vfo, bool force)
void AM_fix_10ms(const unsigned vfo)
{
if(!gSetting_AM_fix || !enabled || vfo > 1 )
return;

if(!force) switch (gCurrentFunction)
{
switch (gCurrentFunction)
{
case FUNCTION_TRANSMIT:
case FUNCTION_BAND_SCOPE:
case FUNCTION_POWER_SAVE:
case FUNCTION_FOREGROUND:
#ifdef ENABLE_AM_FIX_SHOW_DATA
counter = display_update_rate; // queue up a display update as soon as we switch to RX mode
#endif
return;

// only adjust stuff if we're in one of these modes
// only adjust stuff if we're in one of these modes、
case FUNCTION_FOREGROUND:

case FUNCTION_RECEIVE:
case FUNCTION_MONITOR:
case FUNCTION_INCOMING:
Expand Down
3 changes: 2 additions & 1 deletion am_fix.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#ifdef ENABLE_AM_FIX
void AM_fix_init(void);
void AM_fix_reset(const unsigned vfo);
void AM_fix_10ms(const unsigned vfo, bool force);

void AM_fix_10ms(const unsigned vfo);
#ifdef ENABLE_AM_FIX_SHOW_DATA
void AM_fix_print_data(const unsigned vfo, char *s);
#endif
Expand Down
4 changes: 2 additions & 2 deletions app/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "driver/system.h"
#include "am_fix.h"
#include "dtmf.h"
#include "external/printf/printf.h"
//#include "external/printf/printf.h"
#include "frequencies.h"
#include "functions.h"
#include "helper/battery.h"
Expand Down Expand Up @@ -1136,7 +1136,7 @@ void APP_TimeSlice10ms(void)

#ifdef ENABLE_AM_FIX
if (gRxVfo->Modulation == MODULATION_AM)
AM_fix_10ms(gEeprom.RX_VFO, false);
AM_fix_10ms(gEeprom.RX_VFO);
#endif

if (UART_IsCommandAvailable())
Expand Down
Loading

0 comments on commit ff92e4a

Please sign in to comment.