Skip to content

Commit

Permalink
122
Browse files Browse the repository at this point in the history
  • Loading branch information
losehu committed Feb 7, 2024
1 parent 163934d commit a20e39c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 31 deletions.
15 changes: 6 additions & 9 deletions .idea/workspace.xml

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

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ENABLE_MDC1200 ?= 1
ENABLE_MDC1200_SHOW_OP_ARG = 0
ENABLE_MDC1200_SIDE_BEEP = 0
ENABLE_MDC1200_CONTACT = 1
ENABLE_MDC1200_EDIT = 0
ENABLE_MDC1200_EDIT = 1
ENABLE_UART_RW_BK_REGS ?= 0
ENABLE_AUDIO_BAR_DEFAULT ?= 0
ENABLE_EEPROM_TYPE = 0
Expand Down
25 changes: 10 additions & 15 deletions app/spectrum.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ static void DeInitSpectrum() {
isInitialized = false;
}

uint8_t GetBWRegValueForScan() {
static uint8_t GetBWRegValueForScan() {
return scanStepBWRegValues[settings.scanStepIndex];
}

uint16_t GetRssi() {
static uint16_t GetRssi() {
// SYSTICK_DelayUs(800);
// testing autodelay based on Glitch value
while ((BK4819_ReadRegister(0x63) & 0b11111111) >= 255) {
Expand Down Expand Up @@ -791,7 +791,7 @@ static bool IsBlacklisted(uint16_t idx)

// Draw things
// applied x2 to prevent initial rounding
uint8_t Rssi2PX(uint16_t rssi, uint8_t pxMin, uint8_t pxMax) {
static uint8_t Rssi2PX(uint16_t rssi, uint8_t pxMin, uint8_t pxMax) {
const int DB_MIN = settings.dbMin << 1;
const int DB_MAX = settings.dbMax << 1;
const int DB_RANGE = DB_MAX - DB_MIN;
Expand Down Expand Up @@ -843,7 +843,7 @@ static void DrawPower() {
}
}

void DrawStatus( ) {
static void DrawStatus( ) {

#ifdef SPECTRUM_EXTRA_VALUES
sprintf(String, "%d/%d P:%d T:%d", settings.dbMin, settings.dbMax,
Expand Down Expand Up @@ -1081,15 +1081,11 @@ static void OnKeyDownFreqInput(uint8_t key) {
if(DOPPLER_MODE)
{

// 100000
//123012
RTC_TR = ((tempFreq/1000000) << 20) //h十位
| ((tempFreq/100000%10) << 16)//h个位
| ((tempFreq/10000%10) << 12)//min十位
| ((tempFreq/1000%10) << 8)//min个位
| ((tempFreq/100%10) << 4)//sec十位
| ((tempFreq/10%10) << 0);//sec个位
RTC_CFG |= (1 << 2);//打开设置时间功能

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

break;
Expand Down Expand Up @@ -1415,7 +1411,7 @@ bool HandleUserInput() {
ToggleTX(false);
}
#endif
return true;
// return true;
}

if (kbd.current != KEY_INVALID && kbd.current == kbd.prev) {
Expand Down Expand Up @@ -1585,7 +1581,6 @@ static void Tick() {
}
}

bool INT_FLAG = 0;

void APP_RunSpectrum() {

Expand Down
1 change: 0 additions & 1 deletion app/spectrum.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ typedef struct PeakInfo {
} PeakInfo;

void APP_RunSpectrum(void);
void DrawStatus() ;
#ifdef ENABLE_DOPPLER
extern bool DOPPLER_MODE;
void RTCHandler();
Expand Down
2 changes: 1 addition & 1 deletion bsp/dp32g030/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define TEMP2 (*(volatile uint32_t *)(0x40000800u+0x24u))

void RTC_INIT(void);
void RTC_Set( uint8_t time[6]);
void RTC_Set( );
void RTC_Get();

extern uint8_t time[6];
Expand Down
10 changes: 6 additions & 4 deletions driver/rtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void RTC_INIT() {

EEPROM_ReadBuffer(0X2BC0,time,6);

RTC_Set(time);
RTC_Set();

NVIC_SetPriority(Interrupt2_IRQn, 0);

Expand All @@ -26,16 +26,16 @@ void RTC_INIT() {
RTC_IF |= (1 << 0);//清除中断标志位
RTC_IE |= (1 << 0);//使能秒中断

RTC_CFG |= (1 << 2)//打开设置时间功能
| (1 << 0);//RTC使能
RTC_CFG |= //(1 << 2)|//打开设置时间功能
(1 << 0);//RTC使能

NVIC_EnableIRQ(Interrupt2_IRQn);



}

void RTC_Set(uint8_t time[6]) {
void RTC_Set() {



Expand All @@ -52,6 +52,8 @@ void RTC_Set(uint8_t time[6]) {
| (time[4] % 10 << 8)//min个位
| (time[5] / 10 << 4)//sec十位
| (time[5] % 10 << 0);//sec个位
RTC_CFG |= (1 << 2);//打开设置时间功能

}

void RTC_Get() {
Expand Down

0 comments on commit a20e39c

Please sign in to comment.