Browse Source

update

master
zhaohe 2 years ago
parent
commit
987c5fd079
  1. 4
      app/MDK-ARM/startup_stm32f103xb.s
  2. 9
      src/board/hardware.cpp
  3. 13
      src/umain.cpp

4
app/MDK-ARM/startup_stm32f103xb.s

@ -29,7 +29,7 @@
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Stack_Size EQU 0x400
Stack_Size EQU 0x0F00
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
@ -40,7 +40,7 @@ __initial_sp
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Heap_Size EQU 0x200
Heap_Size EQU 0x2000
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base

9
src/board/hardware.cpp

@ -36,7 +36,14 @@ void Hardware::periodicJob() {}
/*******************************************************************************
* *
*******************************************************************************/
void Hardware::debug_light_init() { DEBUG_LIGHT_GPIO.initAsOutput(STM32_GPIO::kOutput_nopull, false, false); }
void Hardware::debug_light_init() {
DEBUG_LIGHT_GPIO.initAsOutput(STM32_GPIO::kOutput_nopull, false, false);
for (size_t i = 0; i < 5; i++) {
DEBUG_LIGHT_GPIO.toggleState();
HAL_Delay(100);
}
}
void Hardware::debug_light_periodicJob() {
static uint32_t lastprocess = 0;
if (sys_haspassedms(lastprocess) > 300) {

13
src/umain.cpp

@ -34,7 +34,7 @@ struct ad77681_init_param ADC_default_init_param = {
.conv_mode = AD77681_CONV_CONTINUOUS, // conv_mode
.diag_mux_sel = AD77681_POSITIVE_FS, // diag_mux_sel
.conv_diag_sel = false, // conv_diag_sel
.conv_len = AD77681_CONV_16BIT, // conv_len
.conv_len = AD77681_CONV_24BIT, // conv_len
.crc_sel = AD77681_CRC, // crc_sel
.status_bit = 0, // status_bit
.VCM_out = AD77681_VCM_HALF_VCC, /* VCM setup*/
@ -61,8 +61,10 @@ void Main::generateScheduleTicket() {
}
}
void Main::adcslaveinit() {}
void Main::onTimerCallbackIRQ(STM32_TIM *tim) {
void Main::adcslaveinit() {}
// #pragma GCC push_options
// #pragma GCC optimize("Ofast")
void Main::onTimerCallbackIRQ(STM32_TIM *tim) {
int32_t voice = m_ad77681.triggerOnceAdcReadAndReadLastResult();
m_voiceCacheQueue.push(&voice);
}
@ -87,6 +89,7 @@ void Main::STM32_GPIO_onIRQ(STM32_GPIO *GPIO_Pin, STM32_GPIO::IrqTypeEvent_t irq
}
}
}
// #pragma GCC pop_options
void Main::main(int argc, char const *argv[]) {
sys_loggger_enable(true);
@ -109,7 +112,7 @@ void Main::main(int argc, char const *argv[]) {
// 初始化音频采集定时器
STM32_TIM2.initialize(&htim2, STM32_TIM::kTimMode_timer);
STM32_TIM2.regListener(this);
STM32_TIM2.startTimerByFreq(16000);
STM32_TIM2.startTimerByFreq(24000);
}
{
@ -154,6 +157,6 @@ void Main::main(int argc, char const *argv[]) {
m_hardware.input_sensors_table_dump(0);
}
// HAL_IWDG_Refresh(&hiwdg);
HAL_IWDG_Refresh(&hiwdg);
}
}
Loading…
Cancel
Save