style: clean up the code

This commit is contained in:
Roy_01
2024-06-25 16:00:30 +08:00
committed by chain40
parent ce018803aa
commit 75ec90e6d9
15 changed files with 17 additions and 45 deletions
+1 -1
View File
@@ -5,8 +5,8 @@
extern "C" {
#endif
#include "adc_drv_if.h"
#include "app_config.h"
#include "adc_drv_if.h"
#define ADC_DRV_ERROR (-1)
#define ADC_DRV_SUCCESS (0)
+2
View File
@@ -1,4 +1,6 @@
#include "adgs1412.h"
#include "elite_board.h"
#include "nrf_delay.h"
#if (DEF_ADGS1412_ENABLED)
-1
View File
@@ -7,7 +7,6 @@ extern "C" {
#include "app_config.h"
#include "sw_drv_if.h"
#include "elite_board.h"
#if (DEF_ADGS1412_ENABLED)
-2
View File
@@ -2,8 +2,6 @@
#include "elite_board.h"
#include "nrf_delay.h"
#include "nrf_log.h"
#include "nrf_spim.h"
#include "FreeRTOS.h"
#include "task.h"
-1
View File
@@ -8,7 +8,6 @@ extern "C" {
#include "app_config.h"
#include "dac_drv_if.h"
#define DAC_DRV_ERROR (-1)
#define DAC_DRV_SUCCESS (0)
-1
View File
@@ -1,4 +1,3 @@
#include "app_config.h"
#include "edc.h"
#include "elite_board.h"
-1
View File
@@ -1,4 +1,3 @@
#include "app_config.h"
#include "elite_board.h"
#include "nrf_drv_spi.h"
+1 -16
View File
@@ -1,19 +1,4 @@
#include "app_config.h"
#include "nrf_log.h"
#if (DEF_ELITE_MODEL == DEF_ELITE_EDC_20)
#include "edc20_io.h"
#elif (DEF_ELITE_MODEL == DEF_PULSE_E_LOAD_10)
#include "pel10_io.h"
#endif
#include "adc_drv.h"
#include "dac_drv.h"
#include "fs.h"
#include "led_drv.h"
#include "sw_drv.h"
#include "btn.h"
#include "elite_board.h"
void elite_board_init(void)
{
+8 -7
View File
@@ -6,21 +6,22 @@ extern "C" {
#endif
#include "app_config.h"
#include "adc_drv.h"
#include "dac_drv.h"
#include "fs.h"
#include "led_drv.h"
#include "sw_drv.h"
#include "btn.h"
#if (DEF_ELITE_MODEL == DEF_ELITE_DEV)
#elif (DEF_ELITE_MODEL == DEF_ELITE_EDC_20)
#include "edc20_io.h"
#elif (DEF_ELITE_MODEL == DEF_PULSE_E_LOAD_10)
#include "pel10_io.h"
#else
#error "Not implemented xxx_pin_ctrl.h"
#error "Not implemented xxx_io.h"
#endif
#include "adc_drv.h"
#include "dac_drv.h"
#include "fs.h"
#include "led_drv.h"
#include "sw_drv.h"
void elite_board_init(void);
void elite_board_power_off(void);
void elite_drv_init(void);
+1
View File
@@ -6,6 +6,7 @@ extern "C" {
#endif
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
struct led_color
+2 -12
View File
@@ -10,8 +10,6 @@ extern "C"
#include "elite_board.h"
#include "sdk_config.h"
#include "nrf_delay.h"
#include "nrf_gpio.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
@@ -19,13 +17,6 @@ extern "C"
#include "nrf_sdh_ble.h"
#include "nrf_sdh_freertos.h"
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include <math.h>
#include <string.h>
#ifdef __cplusplus
}
#endif
@@ -44,13 +35,12 @@ static void le_evt_handler(ble_evt_t const *p_ble_evt, void *p_context)
case BLE_GAP_EVT_CONN_PARAM_UPDATE:
NRF_LOG_INFO("Connection parameters updated.");
break;
case BLE_GAP_EVT_CONNECTED: {
case BLE_GAP_EVT_CONNECTED:
NRF_LOG_INFO("Connect to peer.");
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, p_ble_evt->evt.gap_evt.conn_handle, 8);
APP_ERROR_CHECK(err_code);
led_set(LED_IDEL_CONNECTED);
}
break;
break;
case BLE_GAP_EVT_DISCONNECTED:
NRF_LOG_INFO("Disconnect from peer.");
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, p_ble_evt->evt.gap_evt.conn_handle, 0);
-1
View File
@@ -1,4 +1,3 @@
#include "app_config.h"
#include "elite_board.h"
#include "nrf_spim.h"
-1
View File
@@ -1,4 +1,3 @@
#include "app_config.h"
#include "sw_drv.h"
#if (DEF_ADGS1412_ENABLED)
+1 -1
View File
@@ -5,7 +5,7 @@
extern "C" {
#endif
#include <stdlib.h>
#include "app_config.h"
#include "sw_drv_if.h"
#define SW_DRV_ERROR (-1)
+1
View File
@@ -6,6 +6,7 @@ extern "C" {
#endif
#include <stdint.h>
#include <stdlib.h>
typedef union
{