6 Commits

Author SHA1 Message Date
f67baed8c5 Revert "test"
This reverts commit f8a41af344.
2025-01-20 15:25:56 +08:00
ac74c30923 Revert "update"
This reverts commit cc4d898114.
2025-01-20 15:25:51 +08:00
9f615ba3a3 Revert "更改协议处理部分,但是串口没反应?"
This reverts commit 705cb68764.
2025-01-20 15:25:48 +08:00
705cb68764 更改协议处理部分,但是串口没反应? 2025-01-20 01:30:18 +08:00
cc4d898114 update 2025-01-17 17:29:17 +08:00
f8a41af344 test 2025-01-16 00:31:37 +08:00
3 changed files with 8 additions and 15 deletions

View File

@@ -44,7 +44,6 @@ OF SUCH DAMAGE.
#include "fwdgt.h" #include "fwdgt.h"
#include "board_config.h" #include "board_config.h"
#include "gd60914.h" #include "gd60914.h"
#include "ultrasonic_analog.h"
#ifdef SOFTWARE_IIC #ifdef SOFTWARE_IIC
#include "soft_i2c.h" #include "soft_i2c.h"

View File

@@ -15,7 +15,7 @@ void watchdog_init(void) {
rcu_osci_stab_wait(RCU_IRC40K); rcu_osci_stab_wait(RCU_IRC40K);
/* Configure FWDGT counter clock: 40KHz(IRC40K) / 64 = 0.625 KHz */ /* Configure FWDGT counter clock: 40KHz(IRC40K) / 64 = 0.625 KHz */
fwdgt_config(625, FWDGT_PSC_DIV256); // Set timeout to 1 seconds (625 / 0.625 KHz) fwdgt_config(625, FWDGT_PSC_DIV64); // Set timeout to 1 seconds (625 / 0.625 KHz)
/* Enable FWDGT */ /* Enable FWDGT */
fwdgt_enable(); fwdgt_enable();

View File

@@ -27,29 +27,23 @@ int main(void)
/* configure FWDGT */ /* configure FWDGT */
watchdog_init(); watchdog_init();
// #ifdef SOFTWARE_IIC #ifdef SOFTWARE_IIC
// soft_i2c_config(); soft_i2c_config();
// #else #else
// i2c_config(); i2c_config();
// #endif #endif
printf("system start!\r\n"); printf("system start!\r\n");
ultrasonic_config(); ultrasonic_config();
while(1){ while(1){
// gd60914_get_object_tempture(); gd60914_get_object_tempture();
delay_ms(500); delay_ms(50);
ultrasonic_pwm_out_cycles(ULTRASONIC_TX_CYCLES); ultrasonic_pwm_out_cycles(ULTRASONIC_TX_CYCLES);
delay_ms(10);
uint16_t distance = ultrasonic_calc_distance();
printf("%u\r\n", distance);
watchdog_reload(); watchdog_reload();
} }
} }