Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Jan 28, 2025
1 parent ffb94b8 commit 4ae540b
Show file tree
Hide file tree
Showing 26 changed files with 1,889 additions and 227 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

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

588 changes: 588 additions & 0 deletions .idea/editor.xml

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions .idea/misc.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

65 changes: 38 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@ ENABLE_SWD ?= 1
ENABLE_OVERLAY ?= 0
ENABLE_LTO ?= 1

# ---- STOCK QUANSHENG FERATURES ----
# ---- STOCK QUANSHENG FERATURfvzES ----
ENABLE_UART ?= 1
ENABLE_AIRCOPY ?= 0
ENABLE_FMRADIO = 0
ENABLE_NOAA ?= 0
ENABLE_VOICE ?= 0
ENABLE_VOX ?= 1
ENABLE_VOX ?= 0
ENABLE_ALARM ?= 0
ENABLE_TX1750 ?= 0
ENABLE_PWRON_PASSWORD ?= 0
ENABLE_DTMF_CALLING ?= 1
ENABLE_FLASHLIGHT ?= 1
ENABLE_FLASHLIGHT ?= 0
ENABLE_BOOTLOADER ?= 0
# ---- CUSTOM MODS ----
ENABLE_BIG_FREQ ?= 1
ENABLE_KEEP_MEM_NAME ?= 1
ENABLE_WIDE_RX ?= 1
ENABLE_KEEP_MEM_NAME ?= 0
ENABLE_WIDE_RX ?= 0
ENABLE_TX_WHEN_AM ?= 0
ENABLE_F_CAL_MENU ?= 0
ENABLE_CTCSS_TAIL_PHASE_SHIFT ?= 0
ENABLE_BOOT_BEEPS ?= 0
ENABLE_SHOW_CHARGE_LEVEL ?= 0
ENABLE_REVERSE_BAT_SYMBOL ?= 0
ENABLE_NO_CODE_SCAN_TIMEOUT ?= 1
ENABLE_AM_FIX ?= 1
ENABLE_SQUELCH_MORE_SENSITIVE ?= 1
ENABLE_FASTER_CHANNEL_SCAN ?= 1
ENABLE_RSSI_BAR ?= 1
ENABLE_COPY_CHAN_TO_VFO ?= 1
ENABLE_NO_CODE_SCAN_TIMEOUT ?= 0
ENABLE_AM_FIX ?= 0
ENABLE_SQUELCH_MORE_SENSITIVE ?= 0
ENABLE_FASTER_CHANNEL_SCAN ?= 0
ENABLE_RSSI_BAR ?= 0
ENABLE_COPY_CHAN_TO_VFO ?= 0
ENABLE_SPECTRUM = 0
ENABLE_REDUCE_LOW_MID_TX_POWER?= 0
ENABLE_BYP_RAW_DEMODULATORS ?= 0
ENABLE_BLMIN_TMP_OFF ?= 0
ENABLE_SCAN_RANGES ?= 1
ENABLE_SCAN_RANGES ?= 0
ENABLE_MDC1200 = 0
ENABLE_MDC1200_SHOW_OP_ARG = 0
ENABLE_MDC1200_SIDE_BEEP = 0
Expand All @@ -54,8 +54,8 @@ ENABLE_EEPROM_TYPE = 0
ENABLE_CHINESE_FULL = 0
ENABLE_ENGLISH =0
ENABLE_DOCK ?= 0
ENABLE_CUSTOM_SIDEFUNCTIONS ?= 1
ENABLE_SIDEFUNCTIONS_SEND ?= 1
ENABLE_CUSTOM_SIDEFUNCTIONS ?= 0
ENABLE_SIDEFUNCTIONS_SEND ?= 0
ENABLE_BLOCK ?= 0
ENABLE_PINYIN =0
ENABLE_TURN ?=1
Expand All @@ -64,14 +64,15 @@ ENABLE_AM_FIX_SHOW_DATA ?= 0
ENABLE_AGC_SHOW_DATA ?= 0
ENABLE_TIMER ?= 0

ENABLE_WARNING ?= 1
ENABLE_WARNING ?= 0
ENABLE_MESSENGER = 0
ENABLE_MESSENGER_DELIVERY_NOTIFICATION = 0
ENABLE_MESSENGER_NOTIFICATION = 0
ENABLE_4732 =0
ENABLE_4732SSB =0

ENABLE_DOPPLER =0
ENABLE_TLE = 1
#############################################################
PACKED_FILE_SUFFIX = LOSEHU132
ifeq ($(ENABLE_PINYIN),1)
Expand Down Expand Up @@ -166,7 +167,15 @@ endif
ifeq ($(ENABLE_DOPPLER),1)
OBJS += driver/rtc.o
endif
ifeq ($(ENABLE_TLE),1)
OBJS += tle/eci.o
OBJS += tle/sgp.o
OBJS += tle/vec.o
OBJS += tle/tle.o
OBJS += tle/astrotime.o
OBJS += tle/util.o

endif
ifeq ($(ENABLE_MDC1200),1)
OBJS += app/mdc1200.o
endif
Expand Down Expand Up @@ -288,7 +297,7 @@ AS = arm-none-eabi-gcc
LD = arm-none-eabi-gcc

ifeq ($(ENABLE_CLANG),0)
CC = arm-none-eabi-gcc
CC =arm-none-eabi-gcc
# Use GCC's linker to avoid undefined symbol errors
# LD += arm-none-eabi-gcc
else
Expand All @@ -298,7 +307,7 @@ else
# LD = ld.lld
endif

OBJCOPY = arm-none-eabi-objcopy
OBJCOPY =arm-none-eabi-objcopy
SIZE = arm-none-eabi-size

AUTHOR_STRING ?= LOSEHU
Expand Down Expand Up @@ -345,7 +354,7 @@ endif
#CFLAGS += -Wpadded

# catch any and all warnings
CFLAGS += -Wextra
CFLAGS += -Wextra -fno-strict-aliasing
#CFLAGS += -Wpedantic

# 设置PACKED_FILE_SUFFIX,根据ENABLE_CHINESE_FULL的值设置不同的后缀
Expand Down Expand Up @@ -397,6 +406,10 @@ endif
ifeq ($(ENABLE_DOPPLER),1)
CFLAGS += -DENABLE_DOPPLER
endif
ifeq ($(ENABLE_TLE),1)
CFLAGS += -DENABLE_TLE

endif
ifeq ($(ENABLE_4732),1)
CFLAGS += -DENABLE_4732
endif
Expand Down Expand Up @@ -596,12 +609,7 @@ endif

full:
$(RM) *.bin
$(MAKE) build ENABLE_CHINESE_FULL=0 ENABLE_ENGLISH=1 ENABLE_FMRADIO=1 ENABLE_MESSENGER=1 ENABLE_MESSENGER_DELIVERY_NOTIFICATION=1 ENABLE_MESSENGER_NOTIFICATION=1 ENABLE_SPECTRUM=1 ENABLE_MDC1200=1 ENABLE_MDC1200_EDIT=1 ENABLE_MDC1200_CONTACT=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_ENGLISH=1 ENABLE_DOPPLER=1 ENABLE_SPECTRUM=1 ENABLE_FMRADIO=1 ENABLE_MDC1200=1 ENABLE_MDC1200_EDIT=1 ENABLE_MDC1200_CONTACT=1
$(MAKE) build ENABLE_CHINESE_FULL=0 ENABLE_SPECTRUM=1 ENABLE_FMRADIO=1 ENABLE_MDC1200=1 ENABLE_MDC1200_EDIT=1 ENABLE_MDC1200_CONTACT=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_DOPPLER=1 ENABLE_SPECTRUM=1 ENABLE_FMRADIO=1 ENABLE_MDC1200=1 ENABLE_MDC1200_EDIT=1 ENABLE_MDC1200_CONTACT=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_DOPPLER=1 ENABLE_PINYIN=1 ENABLE_SPECTRUM=1 ENABLE_FMRADIO=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_PINYIN=1 ENABLE_4732=1 ENABLE_4732SSB=1 ENABLE_SPECTRUM=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_DOPPLER=0 ENABLE_PINYIN=0 ENABLE_SPECTRUM=0 ENABLE_FMRADIO=0

test:
$(RM) *.bin
Expand Down Expand Up @@ -640,15 +648,18 @@ flash:
version.o: .FORCE

$(TARGET): $(OBJS)
@$(LD) $(LDFLAGS) $^ -o $@ $(LIBS)
@$(LD) $(LDFLAGS) $^ -o $@ $(LIBS) -lc -g -lm


bsp/dp32g030/%.h: hardware/dp32g030/%.def

%.o: %.c | $(BSP_HEADERS)
@$(CC) $(CFLAGS) $(INC) -c $< -o $@
@$(CC) $(CFLAGS) $(INC) -c $< -o $@ -lc -g -lm


%.o: %.S
@$(AS) $(ASFLAGS) $< -o $@
@$(AS) $(ASFLAGS) $< -o $@ -lc -g -lm


.FORCE:

Expand Down
12 changes: 6 additions & 6 deletions app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,9 @@ static void OnKeyDownFreqInput(uint8_t key) {
{


time[3]=tempFreq/100000;
time[4]=(tempFreq/1000)%100;
time[5]=(tempFreq/10)%100;
my_time[3]=tempFreq/100000;
my_time[4]=(tempFreq/1000)%100;
my_time[5]=(tempFreq/10)%100;
RTC_Set();
SetState(previousState);

Expand Down Expand Up @@ -1278,7 +1278,7 @@ static void Draw_DOPPLER_Process(uint8_t DATA_LINE) {
else
gFrameBuffer[6][i + 80] = 0b00100010;
}
sprintf(String, "20%02d-%02d-%02d %02d:%02d:%02d", time[0], time[1], time[2], time[3], time[4], time[5]);
sprintf(String, "20%02d-%02d-%02d %02d:%02d:%02d", my_time[0], my_time[1], my_time[2], my_time[3], my_time[4], my_time[5]);
GUI_DisplaySmallest(String, 1, DATA_LINE + 23, false, true);
}

Expand Down Expand Up @@ -1530,7 +1530,7 @@ static void Tick() {
if (gNextTimeslice_500ms) {
gNextTimeslice_500ms = false;

// if a lot of steps then it takes long time
// if a lot of steps then it takes long my_time
// we don't want to wait for whole scan
// listening has it's own timer
if(GetStepsCount()>128 && !isListening) {
Expand Down Expand Up @@ -1660,7 +1660,7 @@ void RTCHandler(void) {


RTC_Get();
int32_t NOW_UNIX_TIME = UNIX_TIME(time);
int32_t NOW_UNIX_TIME = UNIX_TIME(my_time);
time_diff = satellite.START_TIME_UNIX - NOW_UNIX_TIME; //卫星开始时间-现在时间
time_diff1 = satellite.sum_time + time_diff;//结束-开始+开始-现在

Expand Down
10 changes: 4 additions & 6 deletions board.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ void BOARD_Init(void) {
BACKLIGHT_InitHardware();
BOARD_ADC_Init();
ST7565_Init();
#ifdef ENABLE_FMRADIO
BK1080_Init(0, false);
#endif


#if defined(ENABLE_UART) || defined(ENABLED_AIRCOPY)
CRC_Init();
Expand All @@ -477,11 +475,11 @@ void BOARD_Init(void) {
}

void write_to_memory(uint32_t address, uint32_t data) {
// 将地址数值转换为指针
// ����ַ��ֵת��Ϊָ��
uint32_t *target_address = (uint32_t *) address;
// 向目标地址写入数据
// ��Ŀ���ַд������
*target_address = data;
// 为了避免优化,确保代码不会被优化掉
// Ϊ�˱����Ż���ȷ�����벻�ᱻ�Ż���
volatile uint32_t read_back = *target_address;
}
//JUMP_TO_FLASH(0xa10A,0x20003ff0);
Expand Down
2 changes: 1 addition & 1 deletion bsp/dp32g030/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ void RTC_INIT(void);
void RTC_Set( );
void RTC_Get();

extern uint8_t time[6];
extern uint8_t my_time[6];

#endif
1 change: 0 additions & 1 deletion compile-with-docker.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@echo on
make clean
docker build -t uvk5 .
docker run --rm -v %CD%\compiled-firmware:/app/compiled-firmware uvk5 /bin/bash -c "cd /app &&rm -rf compiled&& make clean && make full&& cp *.bin compiled-firmware/"
pause
2 changes: 1 addition & 1 deletion del_linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
target_directory="./"
find "$target_directory" -type f \( -name "*.o" -o -name "*.d" \) -delete
find "$target_directory" -type f \( -name "*.o" -o -name "*.d" \)
echo "Deletion complete."
4 changes: 2 additions & 2 deletions driver/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "driver/system.h"
#include "ui/helper.h"

uint8_t time[6];
uint8_t my_time[6];

void RTC_INIT() {

Expand All @@ -19,7 +19,7 @@ void RTC_INIT() {
| (0 << 24);//PRE_PERIOD=8s


EEPROM_ReadBuffer(0X2BC0, time, 6);
EEPROM_ReadBuffer(0X2BC0, my_time, 6);

RTC_Set();

Expand Down
Loading

0 comments on commit 4ae540b

Please sign in to comment.