shit-202408082000
This commit is contained in:
@@ -1,30 +1,35 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "gd32e23x.h"
|
||||
#include "systick.h"
|
||||
|
||||
#include "chirp_smartsonic.h"
|
||||
#include "soniclib.h"
|
||||
#include "chirp_bsp.h"
|
||||
|
||||
#include "board_init.h"
|
||||
#include "chirp_board_config.h"
|
||||
|
||||
#include "app_config.h"
|
||||
|
||||
|
||||
/*!
|
||||
\brief LED Turn On
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void sensor_led_on(void) {
|
||||
gpio_bit_reset(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Lo LED = On
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief LED Turn Off
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void sensor_led_off(void) {
|
||||
gpio_bit_set(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN); // PB1 = Hi LED = Off
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief LED Toggle
|
||||
\param[in] none
|
||||
\param[out] none
|
||||
\retval none
|
||||
*/
|
||||
void sensor_led_toggle(void)
|
||||
{
|
||||
gpio_bit_toggle(CHIRP_PIN_LED_PORT, CHIRP_PIN_LED_PIN);
|
||||
|
@@ -38,7 +38,7 @@ static void measure_idd(uint16_t nb_measure){
|
||||
}
|
||||
#elif
|
||||
static void measure_idd(uint16_t nb_measure){
|
||||
|
||||
__NOP();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -95,7 +95,6 @@ static void find_sensors(void)
|
||||
} else {
|
||||
printf("not found!\n");
|
||||
}
|
||||
|
||||
gpio_bit_reset(CHIRP_PIN_PROG_PORT, CHIRP_PIN_PROG_PIN);
|
||||
}
|
||||
|
||||
@@ -149,19 +148,13 @@ void chbsp_board_init(ch_group_t *grp_ptr) {
|
||||
grp_ptr->num_i2c_buses = CHIRP_NUM_I2C_BUSES;
|
||||
grp_ptr->rtc_cal_pulse_ms = CHBSP_RTC_CAL_PULSE_MS;
|
||||
|
||||
/* Initialize the GD32 system. */
|
||||
// systick_config();
|
||||
board_init_I2C();
|
||||
|
||||
configure_console();
|
||||
|
||||
ADC0_init();
|
||||
ext_int_init();
|
||||
|
||||
/* Probe I2C bus to find connected sensor(s) */
|
||||
find_sensors();
|
||||
measure_power();
|
||||
|
||||
indicate_alive();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user