Browse Source

fix: 灯光模块
亮度分级功能修复, adc模块修改

kindring 1 year ago
parent
commit
6b7db0595e
3 changed files with 8 additions and 7 deletions
  1. 4 3
      src/control/readAdc.c
  2. 3 3
      src/control/readAdc.h
  3. 1 1
      src/light.c

+ 4 - 3
src/control/adc.c → src/control/readAdc.c

@@ -45,7 +45,7 @@
 #include "bcomdef.h"
 #include "adc.h"
 #include "OSAL.h"
-#include "adc_demo.h"
+#include "readAdc.h"
 #include "log.h"
 
 /*********************************************************************
@@ -88,10 +88,10 @@ then the pair of [P20~P15,P14~P13,P12~P11] will work.
 other adc channel cannot work.
 */
 adc_Cfg_t adc_cfg = {
-	.channel = ADC_BIT(ADC_CH3P_P20)|ADC_BIT(ADC_CH2P_P14)|ADC_BIT(ADC_CH3N_P15),
+	.channel = ADC_BIT(ADC_CH2P_P14),
 	.is_continue_mode = FALSE,
 	.is_differential_mode = 0x00,
-	.is_high_resolution = 0x7F,
+	.is_high_resolution = 0xFFF,
 };
 
 /*********************************************************************
@@ -202,6 +202,7 @@ static void adc_evt(adc_Evt_t* pev)
 
 static void adcMeasureTask( void )
 {
+	// 1. config adc channel
 	int ret;
 	bool batt_mode = FALSE;
 	uint8_t batt_ch = ADC_CH3P_P20;

+ 3 - 3
src/control/adc.h → src/control/readAdc.h

@@ -38,8 +38,8 @@
 
 **************************************************************************************************/
 
-#ifndef HEARTRATE_H
-#define HEARTRATE_H
+#ifndef READ_ADC_H
+#define READ_ADC_H
 
 #ifdef __cplusplus
 extern "C"
@@ -83,4 +83,4 @@ extern uint16 adc_ProcessEvent( uint8 task_id, uint16 events );
 }
 #endif
 
-#endif /* HEARTRATE_H */
+#endif /* READ_ADC_H */

+ 1 - 1
src/light.c

@@ -14,7 +14,7 @@ uint8 task_light_id;
 
 uint32_t _light_total = TOTAl_LEVEL;
 // 配置 
-light_data_t light_data = {true, LIGHT_MODE_DEFAULT, TEMP_MAX, 100, , 100};
+light_data_t light_data = {true, LIGHT_MODE_DEFAULT, TEMP_MAX, 100, 100};
 
 // 通知回调函数
 LightCallbackFunc notify_callback = NULL;