|
@@ -1,4 +1,4 @@
|
|
-#include "app_chargerpin_conn_detect.h"
|
|
|
|
|
|
+#include "app_chargerpin_conn_detect.h"
|
|
#include "system.h"
|
|
#include "system.h"
|
|
#include "bsp_time.h"
|
|
#include "bsp_time.h"
|
|
#include "bsp_adc.h"
|
|
#include "bsp_adc.h"
|
|
@@ -274,7 +274,7 @@ static void app_pair_host_process(void)
|
|
case 2:
|
|
case 2:
|
|
|
|
|
|
break;
|
|
break;
|
|
- case 3://¨¦?¨¤-¨¨?¡ä¨®?¨²¡¤¡é??????D?o?
|
|
|
|
|
|
+ case 3://é?à -è?′ó?ÃºÂ·ï¿ ??????D?o?
|
|
if ((TIME_GetTicks() - host_ram.delay_pair_count > ADC_CHECKMS+ADC_CHECKMS))
|
|
if ((TIME_GetTicks() - host_ram.delay_pair_count > ADC_CHECKMS+ADC_CHECKMS))
|
|
{
|
|
{
|
|
PAIR_CHARGERPIN_PRINT(" UP pull over time %d \n", TIME_GetTicks());
|
|
PAIR_CHARGERPIN_PRINT(" UP pull over time %d \n", TIME_GetTicks());
|
|
@@ -284,7 +284,7 @@ static void app_pair_host_process(void)
|
|
Process_SetHoldOn(app_pair_host_process,0);
|
|
Process_SetHoldOn(app_pair_host_process,0);
|
|
host_ram.statu=1;
|
|
host_ram.statu=1;
|
|
}
|
|
}
|
|
- else if(nrf_gpio_pin_read(PIN_CHARGING))//?¨¢¦Ì?¨¦?¨¤-D?o?¨°?o¨®¡ê??¦Ì?¡Âclient¨°??-¨¢??¨®¨¦?
|
|
|
|
|
|
+ else if(nrf_gpio_pin_read(PIN_CHARGING))//?áμ?é?à -D?o?ò?oó£??μ?÷clientò??-á??óé?
|
|
{
|
|
{
|
|
PAIR_CHARGERPIN_PRINT(" nrf_gpio_pin_read(PIN_CHARGING SUCCESS \n", TIME_GetTicks());
|
|
PAIR_CHARGERPIN_PRINT(" nrf_gpio_pin_read(PIN_CHARGING SUCCESS \n", TIME_GetTicks());
|
|
host_ram.statu=4;
|
|
host_ram.statu=4;
|
|
@@ -355,7 +355,7 @@ static void app_pair_host_process(void)
|
|
|
|
|
|
|
|
|
|
#define CONN_MAX_ADC 1000
|
|
#define CONN_MAX_ADC 1000
|
|
-#define CONN_MIN_ADC 600
|
|
|
|
|
|
+#define CONN_MIN_ADC 750
|
|
void app_pair_client_init(Event into,Event over)
|
|
void app_pair_client_init(Event into,Event over)
|
|
{
|
|
{
|
|
client_ram.init=1;
|
|
client_ram.init=1;
|
|
@@ -395,7 +395,7 @@ void app_pair_client_process_case1(void)
|
|
client_ram.pair_line=CHARGE;
|
|
client_ram.pair_line=CHARGE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- else if(client_ram.adc_value>CONN_MIN_ADC)
|
|
|
|
|
|
+ else if((client_ram.adc_value>CONN_MIN_ADC)&&(client_ram.adc_value < CONN_MIN_ADC+100))
|
|
{
|
|
{
|
|
PAIR_CHARGERPIN_PRINT("CONNECT_NO_CHARGE\n");
|
|
PAIR_CHARGERPIN_PRINT("CONNECT_NO_CHARGE\n");
|
|
if(client_ram.pair_line!=CONNECT_NO_CHARGE)
|
|
if(client_ram.pair_line!=CONNECT_NO_CHARGE)
|
|
@@ -415,7 +415,7 @@ void app_pair_client_process_case1(void)
|
|
NRF_GPIO_PIN_D0H1,
|
|
NRF_GPIO_PIN_D0H1,
|
|
NRF_GPIO_PIN_NOSENSE);
|
|
NRF_GPIO_PIN_NOSENSE);
|
|
nrf_gpio_cfg_watcher(PIN_CHARGING);
|
|
nrf_gpio_cfg_watcher(PIN_CHARGING);
|
|
- nrf_gpio_pin_set(PIN_CHARGING);//¨¤-??100ms
|
|
|
|
|
|
+ nrf_gpio_pin_set(PIN_CHARGING);//Ã -??100ms
|
|
|
|
|
|
client_ram.delay_pair_count=TIME_GetTicks();
|
|
client_ram.delay_pair_count=TIME_GetTicks();
|
|
Process_UpdatePeroid(app_pair_client_process,1);
|
|
Process_UpdatePeroid(app_pair_client_process,1);
|
|
@@ -475,7 +475,7 @@ static void app_pair_client_process(void)
|
|
|
|
|
|
break;
|
|
break;
|
|
case 2:
|
|
case 2:
|
|
- if(TIME_GetTicks() - client_ram.delay_pair_count > 100)//¦Ì¨¨100ms
|
|
|
|
|
|
+ if(TIME_GetTicks() - client_ram.delay_pair_count > 100)//μè100ms
|
|
{
|
|
{
|
|
nrf_gpio_pin_clear(PIN_CHARGING);
|
|
nrf_gpio_pin_clear(PIN_CHARGING);
|
|
client_ram.statu=3;
|
|
client_ram.statu=3;
|