Skip to content

Commit

Permalink
129
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Jun 9, 2024
1 parent a3de784 commit 8e19866
Show file tree
Hide file tree
Showing 14 changed files with 408 additions and 75 deletions.
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

9 changes: 0 additions & 9 deletions .vscode/settings.json

This file was deleted.

98 changes: 64 additions & 34 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ENABLE_LTO ?= 1
# ---- STOCK QUANSHENG FERATURES ----
ENABLE_UART ?= 1
ENABLE_AIRCOPY ?= 0
ENABLE_FMRADIO = 1
ENABLE_FMRADIO = 0
ENABLE_NOAA ?= 0
ENABLE_VOICE ?= 0
ENABLE_VOX ?= 1
Expand All @@ -38,16 +38,16 @@ ENABLE_SQUELCH_MORE_SENSITIVE ?= 1
ENABLE_FASTER_CHANNEL_SCAN ?= 1
ENABLE_RSSI_BAR ?= 1
ENABLE_COPY_CHAN_TO_VFO ?= 1
ENABLE_SPECTRUM ?= 1
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_MDC1200 = 1
ENABLE_MDC1200 = 0
ENABLE_MDC1200_SHOW_OP_ARG = 0
ENABLE_MDC1200_SIDE_BEEP = 0
ENABLE_MDC1200_CONTACT = 1
ENABLE_MDC1200_EDIT = 1
ENABLE_MDC1200_CONTACT = 0
ENABLE_MDC1200_EDIT = 0
ENABLE_UART_RW_BK_REGS ?= 0
ENABLE_AUDIO_BAR_DEFAULT ?= 0
ENABLE_EEPROM_TYPE = 0
Expand All @@ -73,7 +73,14 @@ ENABLE_4732SSB =0

ENABLE_DOPPLER =0
#############################################################
PACKED_FILE_SUFFIX = LOSEHU128
PACKED_FILE_SUFFIX = LOSEHU129
ifeq ($(ENABLE_PINYIN),1)
ENABLE_CHINESE_FULL=4
endif

ifeq ($(ENABLE_DOPPLER),1)
ENABLE_SPECTRUM=1
endif

ifeq ($(ENABLE_CHINESE_FULL),0)
ifeq ($(ENABLE_ENGLISH),1)
Expand All @@ -96,12 +103,16 @@ ifeq ($(ENABLE_CHINESE_FULL),4)
endif
endif
ifeq ($(ENABLE_4732),1)
ENABLE_4732=1
ENABLE_FMRADIO=0
PACKED_FILE_SUFFIX := $(PACKED_FILE_SUFFIX)S

$(info SI4732)

endif
ifeq ($(ENABLE_FMRADIO),1)
ENABLE_4732=0
endif


CFLAGS =


Expand All @@ -112,14 +123,7 @@ ifeq ($(ENABLE_MDC1200),0)
ENABLE_MDC1200_EDIT =0
endif

ifeq ($(ENABLE_CHINESE_FULL),0)
ENABLE_EEPROM_TYPE=0
ENABLE_MESSENGER =0
ENABLE_MESSENGER_DELIVERY_NOTIFICATION = 0
ENABLE_MESSENGER_NOTIFICATION = 0

$(info Normal)
endif


OPENOCD = openocd-win/bin/openocd.exe
Expand Down Expand Up @@ -190,7 +194,7 @@ ifeq ($(ENABLE_4732),1)
OBJS += app/si.o
OBJS += driver/si473x.o
OBJS += helper/rds.o

OBJS += app/spectrum.o
endif
OBJS += driver/gpio.o
OBJS += driver/i2c.o
Expand Down Expand Up @@ -320,7 +324,7 @@ ifeq ($(ENABLE_OVERLAY),1)
endif

ifeq ($(ENABLE_CLANG),0)
CFLAGS += -Os -Wall -Wno-error -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c2x -MMD
CFLAGS += -Os -Wall -Wno-error -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c2x -MMD -w
#CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c11 -MMD
#CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=c99 -MMD
#CFLAGS += -Os -Wall -Werror -mcpu=cortex-m0 -fno-builtin -fshort-enums -fno-delete-null-pointer-checks -std=gnu99 -MMD
Expand Down Expand Up @@ -588,31 +592,26 @@ endif

full:
$(RM) *.bin
$(MAKE) build ENABLE_CHINESE_FULL=0 ENABLE_ENGLISH=1 ENABLE_MESSENGER=1 ENABLE_MESSENGER_DELIVERY_NOTIFICATION=1 ENABLE_MESSENGER_NOTIFICATION=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_ENGLISH=1 ENABLE_DOPPLER=1
$(MAKE) build ENABLE_CHINESE_FULL=0
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_DOPPLER=1
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_DOPPLER=1 ENABLE_PINYIN=1 ENABLE_MDC1200=0 ENABLE_MDC1200_EDIT=0 ENABLE_MDC1200_CONTACT=0
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_PINYIN=1 ENABLE_MDC1200=0 ENABLE_MDC1200_EDIT=0 ENABLE_MDC1200_CONTACT=0 ENABLE_4732=1 ENABLE_4732SSB=1 ENABLE_FMRADIO=0
$(MAKE) build ENABLE_CHINESE_FULL=4 ENABLE_FMRADIO=0 ENABLE_4732=1
$(MAKE) build ENABLE_CHINESE_FULL=0 ENABLE_FMRADIO=0 ENABLE_4732=1 ENABLE_ENGLISH=1
$(MAKE) build ENABLE_CHINESE_FULL=0 ENABLE_FMRADIO=0 ENABLE_4732=1 ENABLE_MDC1200=0 ENABLE_MDC1200_EDIT=0 ENABLE_MDC1200_CONTACT=0
$(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

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



build:clean $(TARGET)
$(OBJCOPY) -O binary $(TARGET) $(TARGET).bin
@$(OBJCOPY) -O binary $(TARGET) $(TARGET).bin
ifndef MY_PYTHON
$(info )
$(info !!!!!!!! PYTHON NOT FOUND, *.PACKED.BIN WON'T BE BUILT)
$(info )
else ifneq (,$(HAS_CRCMOD))
$(info )
$(info !!!!!!!! CRCMOD NOT INSTALLED, *.PACKED.BIN WON'T BE BUILT)
$(info !!!!!!!! run: pip install crcmod)
$(info )
else
Expand All @@ -623,6 +622,7 @@ endif




all:
$(MAKE) build
$(MAKE) flash
Expand All @@ -636,19 +636,49 @@ flash:
version.o: .FORCE

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

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

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

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

.FORCE:

-include $(DEPS)

CUSCANSHU ?= NUL
CUSTOMNAME ?= NUL
full_all:
$(MAKE) build_all $(CUSCANSHU) CUSTOMNAME="$(CUSTOMNAME)"


build_all: clean $(TARGET)
$(OBJCOPY) -O binary $(TARGET) $(TARGET).bin
ifndef MY_PYTHON

else ifneq (,$(HAS_CRCMOD))
$(info )
$(info !!!!!!!! run: pip install crcmod)
$(info )
else
-$(MY_PYTHON) fw-pack.py $(TARGET).bin $(AUTHOR_STRING) $(CUSTOMNAME).bin
endif
$(SIZE) $(TARGET)




clean:
$(RM) $(call FixPath, $(TARGET).bin $(PACKED_FILE_SUFFIX).bin $(TARGET) $(OBJS) $(DEPS))
@$(RM) $(call FixPath, $(TARGET).bin $(PACKED_FILE_SUFFIX).bin $(TARGET) )

ifeq ($(OS), Windows_NT) # Windows 系统
@call del_win.bat
else # 类 Unix 系统(Linux, macOS, 等)
chmod +x del_linux.sh
./del_linux.sh
endif

15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

**语言版本: [English](README_en.md), [中文](README.md).**


# [K5Web]( https://k5.vicicode.com/)
* 支持在线固件功能编译,无需安装编译环境!!
* 多普勒卫星、开机图片文字、SI4732 SSB补丁的写频方式!
* 支持**创意工坊**,注册后登录可上传自定义固件和开机图片!!!

请访问:[K5Web]( https://k5.vicicode.com/)

# 版本说明

* 目前分为如下几个版本:**LOSEHUxxx****LOSEHUxxxK****LOSEHUxxxH****LOSEHUxxxE****LOSEHUxxxEK****LOSEHUxxxHS**
Expand All @@ -12,13 +20,6 @@
* **LOSEHUxxxE**:英文固件,无需扩容,包含MDC1200、频谱、收音机、短信
* **LOSEHUxxxEK**:英文固件,需要1Mib以上Eeprom,包含多普勒模式、MDC1200、频谱、收音机、自定义开机字符、开机图片

# 写频方式

关于多普勒卫星、开机图片文字、SI4732 SSB补丁的写频方式

支持创意工坊,注册后登录可上传自定义固件和开机图片!!!

请参考:[K5Web]( https://k5.vicicode.com/)

# 多功能的K5/6固件

Expand Down
11 changes: 8 additions & 3 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
* ......
* More available flash allows for additional custom features(about 1.5K?).


# [K5Web](https://k5.vicicode.com/)
* Supports online firmware compilation, no need to install a compilation environment!!
* Doppler satellite, boot image text, and SI4732 SSB patch writing method!
* Supports **Creative Workshop**, where you can upload custom firmware and boot images after registering and logging in!!!

Visit: [K5Web](https://k5.vicicode.com/)

# Version Description
* Currently, the firmware is available in the following versions: **LOSEHUxxx**, **LOSEHUxxxK**, **LOSEHUxxxH**, **LOSEHUxxxE**, **LOSEHUxxxEK**, **LOSEHUxxxHS**
* **LOSEHUxxx**: Chinese firmware, no additional EEPROM needed, includes MDC1200, spectrum, and radio.
Expand All @@ -23,10 +31,7 @@
* **LOSEHUxxxE**: English firmware, no additional EEPROM needed, includes MDC1200, spectrum, radio, and messaging.
* **LOSEHUxxxEK**: English firmware, requires more than 1Mib EEPROM, includes Doppler mode, MDC1200, spectrum, radio, custom boot characters, and boot image.

# Frequency Writing Method
Regarding Doppler satellites and bootup image text frequency writing method.

Please refer to: [K5Web](https://k5.vicicode.com/)

# Multi-functional K5/6 Firmware

Expand Down
2 changes: 2 additions & 0 deletions app/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ cnt_i--;
}

}else{
#ifdef ENABLE_DOPPLER
DOPPLER_MODE=1;
#endif
APP_RunSpectrum();
gRequestDisplayScreen = DISPLAY_MAIN;
}
Expand Down
9 changes: 9 additions & 0 deletions del_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# 设置目标目录
target_directory="./" # 替换为你的目标目录路径

# 删除 .o 和 .d 文件
find "$target_directory" -type f \( -name "*.o" -o -name "*.d" \) -delete

echo "Deletion complete."
14 changes: 14 additions & 0 deletions del_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off
setlocal

rem 设置目标目录
set "target_directory=./" rem 替换为你的目标目录路径

rem 删除 .o 和 .d 文件
for /r "%target_directory%" %%f in (*.o *.d) do (
del "%%f"
)

echo Deletion complete.
endlocal

4 changes: 3 additions & 1 deletion driver/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ uint8_t time[6];

void RTC_INIT() {

uint32_t correct_freq = 32768 - 1 + ((((RC_FREQ_DELTA & 0x400) >> 10) ? 1 : -1) *( RC_FREQ_DELTA & 0x3ff));
uint32_t correct_freq = 32768 - 1 + ((((RC_FREQ_DELTA & 0x400) >> 10) ? 1 : -1) * (RC_FREQ_DELTA & 0x3ff));
// 清空PRE_PERIOD, PRE_DECIMAL 和 PRE_ROUND相关位
RTC_PRE &= ~((0x7fff << 0) | (0xf << 20) | (0x1 << 24));
RTC_PRE |= correct_freq//PRE_ROUND=32768HZ-1
| (0 << 20)//DECIMAL=0
| (0 << 24);//PRE_PERIOD=8s
Expand Down
Loading

0 comments on commit 8e19866

Please sign in to comment.