接上稿,进行控制程序 部分
程序:
- /*
- * File : main.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2009, RT-Thread Development Team
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rt-thread.org/license/LICENSE
- *想用星空派gd32F303开发板资源 (P F 7)输出(19),(PC3)模拟输入(29),板(P F0~3)LED,板(PA 0 、PC13 、 P F 5 、 P F 4)button,来通过光耦中间继电器控制加热设备。
- * Change Logs:
- * Date Author Notes
- * 2021-10-29 first implementation
- */
- #include
- #include
- #include "stdio.h"
- #include
- #include
- #include "gd32f303e_eval.h"
- //#include "systick.h"
- #include "button.h"
- //adc
- float temperature;
- float vref_value;
- volatile uint16_t adc_val_1;
- void rcu_config(void);
- void adc_config(void);
- void adc_init(void);
- void adc_init1(void);
- /*!
- brief main function
- param[in] none
- param[out] none
- retval none
- */
- //adc
- uint8_t pin_count = 0;
- volatile long bootCount = 0; //DF-A进行 1分,1.5分,10分状态。
- volatile uint8_t mind_n_As1; //
- unsigned long startProducing, endProducing;
- volatile float mind_n_key1, mind_n_all, mind_n_oninall;
- // 函数声明
- void DF_B(void*);
- void DF_onoff(uint16_t mind_n_on, uint16_t mind_n_off, uint8_t mind_n_key);
- void DF_A(void*);
- static rt_thread_t tid_dfa,tid_dfb,tid_adc_B;
- void key_init (void)//(PA 0 、PC13 、 P F 5 、 P F 4)
- {
- /* 使能 GPIOC 时钟源 */
- rcu_periph_clock_enable(RCU_GPIOA);
- rcu_periph_clock_enable(RCU_GPIOC);
- rcu_periph_clock_enable(RCU_GPIOF);
- /* 配置按键为 浮空输入 */
- gpio_init(GPIOA, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_0); //34
- gpio_init(GPIOC, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ, GPIO_PIN_13); //7
- gpio_init(GPIOF, GPIO_MODE_IN_FLOATING, GPIO_OSPEED_50MHZ,GPIO_PIN_4|GPIO_PIN_5); //14,15
- }
- void key_exit_mode_init (void)
- {
- //复用功能时钟源
- rcu_periph_clock_enable(RCU_AF);
- /* 配置中断优先级 */
- nvic_irq_enable(EXTI10_15_IRQn, 2U, 0U);
- /* 把对应的引脚连接到 exit外部中断 */
- gpio_exti_source_select(GPIO_PORT_SOURCE_GPIOC, GPIO_PIN_SOURCE_13);
- /* 配置外部中断13 */
- exti_init(EXTI_13, EXTI_INTERRUPT, EXTI_TRIG_FALLING);
- exti_interrupt_flag_clear(EXTI_13);
- }
- uint8_t key_state_get(void)
- {
- return gpio_input_bit_get(GPIOC, GPIO_PIN_13);
- }
- void led_init (void)
- {
- /* 使能对应得时钟源 */
- rcu_periph_clock_enable(RCU_GPIOF);
- /* 配置引脚 */
- gpio_init(GPIOF, GPIO_MODE_OUT_PP, GPIO_OSPEED_50MHZ,GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);//10~13
- }
- void led_on(int lednum)
- {
- switch(lednum)
- {
- case 0:
- gpio_bit_set(GPIOF,GPIO_PIN_0);
- break;
- case 1:
- gpio_bit_set(GPIOF,GPIO_PIN_1);
- break;
- case 2:
- gpio_bit_set(GPIOF,GPIO_PIN_2);
- break;
- case 3:
- gpio_bit_set(GPIOF,GPIO_PIN_3);
- break;
- }
- }
- void led_off(int lednum)
- {
- switch(lednum)
- {
- case 0:
- gpio_bit_reset(GPIOF,GPIO_PIN_0);
- break;
- case 1:
- gpio_bit_reset(GPIOF,GPIO_PIN_1);
- break;
- case 2:
- gpio_bit_reset(GPIOF,GPIO_PIN_2);
- break;
- case 3:
- gpio_bit_reset(GPIOF,GPIO_PIN_3);
- break;
- }
- }
- uint8_t Button_2,Button_3,Button_4 ;
- Button_t Button2;
- Button_t Button3;
- Button_t Button4;
- uint8_t a,b,c;
- uint8_t a_v,b_v,c_v;
- uint8_t Button2_Dowm_v=0,Button2_Dowm_rgbv;
- //返回句柄
- uint8_t pin_r,pin_g, pin_b, pin_4, pinout_19;
- //GPIO模拟PWM的实体
- void pwm_entry(void* p) {
- uint8_t count;
- while(1) {
- //设定脉宽200ms
- count++;
- count %=10;
- rt_thread_mdelay(1);
- //模拟pwm比较
- //红色的pwm输出
- if (a_v==5) {
- if( count>=a) {
- rt_pin_write(pin_r, PIN_LOW);
- }
- else {
- rt_pin_write(pin_r,PIN_HIGH);
- }
- } else {
- rt_pin_write(pin_r,PIN_HIGH);
- }
- //绿色的PWM输出
- if (b_v==5) {
- if(count>=b)
- {
- rt_pin_write(pin_g, PIN_LOW);
- }
- else {
- rt_pin_write(pin_g,PIN_HIGH);
- }
- } else {
- rt_pin_write(pin_g,PIN_HIGH);
- }
- //蓝色的pwm输出
- if (c_v==5) {
- if(count>=c)
- {
- rt_pin_write(pin_b, PIN_LOW);
- }
- else {
- rt_pin_write(pin_b,PIN_HIGH);
- }
- } else {
- rt_pin_write(pin_b,PIN_HIGH);
- }
- }
- }
- void test_button(void* p)
- {
- uint8_t pin_count = 0;
- while (1) {
- Button_Process();
- rt_thread_mdelay(10);
- pin_count++;
- if ((pin_count%500)==19) {
- }
- }
- }
- void pwm_init() {
- rt_thread_t tid1;
- // rt_err_t ret= RT_EOK ;
- /* 设置PIN脚模式为输出 */
- rt_pin_mode(pin_r, PIN_MODE_OUTPUT);
- rt_pin_mode(pin_g, PIN_MODE_OUTPUT);
- rt_pin_mode(pin_b, PIN_MODE_OUTPUT);
- rt_pin_write(pin_r, PIN_HIGH);
- rt_pin_write(pin_g, PIN_HIGH);
- rt_pin_write(pin_b,PIN_HIGH);
- // rt_thread_t rt_thread_create( "pwm_rgb",//const char* name
- // pwm_entry,//void (*entry)(void* parameter)
- // RT_NULL,//void* parameter
- // 512 ,//rt_uint32_t stack_size
- // 3 ,//rt_uint8_t priority
- // 2 );//rt_uint32_t tick
- tid1 = rt_thread_create( "pwm_rgb", pwm_entry, RT_NULL, 512,
- 3,
- 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid1 != RT_NULL)
- rt_thread_startup(tid1);
- // _button_hw_init
- tid1 = rt_thread_create( "button_hw", test_button, RT_NULL, 1024,5, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid1 != RT_NULL)
- rt_thread_startup(tid1);
- // _DF_A_hw_init
- tid_dfa = rt_thread_create( "DF_A", DF_A, RT_NULL, 1024,6, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid_dfa != RT_NULL)
- rt_thread_startup(tid_dfa);
- // xTaskCreate(
- // DF_A, /* Task function. */
- // "DF_A", /* String with name of task. */
- // 20000, /* Stack size in words. */
- // NULL, /* Parameter passed as input of the task */
- // 2, /* Priority of the task. */
- // NULL);
- }
- // Button
- uint8_t Read_Button2_Level(void)
- {
- return rt_pin_read(Button_2);
- }
- uint8_t Read_Button3_Level(void)
- {
- return rt_pin_read(Button_3);
- }
- uint8_t Read_Button4_Level(void)
- {
- return rt_pin_read(Button_4);
- }
- void Btn2_Dowm_CallBack(void *btn)
- {
- rt_kprintf("Button2 Dowm_!");
- adc_init();
- Button2_Dowm_v=1;
- a++;
- rt_kprintf("a=%d",a);
- if (a>10) {
- a_v=5;
- a=0;
- } else {
- a_v=5;
- }
- }
- void Btn2_Double_CallBack(void *btn)
- {
- rt_kprintf("Button2 _Double_!");
- }
- void Btn2_Long_CallBack(void *btn)
- {
- rt_kprintf("Button2_Long_!");
- // Button_Delete(&Button2);
- // rt_kprintf("删除Button2");
- // Search_Button();
- }
- void Btn3_Dowm_CallBack(void *btn)
- {
- rt_kprintf("Button3 _Dowm!");
- adc_init1();
- b++;
- rt_kprintf("b=%d",b);
- if (b>10) {
- b_v=5;
- b=0;
- } else {
- b_v=5;
- }
- }
- void Btn3_Double_CallBack(void *btn)
- {
- rt_kprintf("Button3_Double_!");
- }
- void Btn3_Long_CallBack(void *btn)
- {
- rt_kprintf("Button3 _Long_!");
- // Button_Delete(&Button2);
- // rt_kprintf("删除Button3");
- // Search_Button();
- }
- void Btn4_Dowm_CallBack(void *btn)
- {
- rt_kprintf("Button4 _Dowm!");
- c++;
- if (c>10) {
- c=0;
- }
- }
- void Btn4_Double_CallBack(void *btn)
- {
- rt_kprintf("Button4 _Double_!");
- }
- void Btn4_Long_CallBack(void *btn)
- {
- rt_kprintf("Button4 long_Dowm !");
- // Button_Delete(&Button2);
- // rt_kprintf("删除Button4");
- // Search_Button();
- }
- uint32_t adc_srt[10];
- void adc_B(void * parameter)
- {
- uint32_t adc_srt_time,adc_ssys_time,adc_ert_time,adc_esys_time;
- while (1) {
- adc_srt[0]=adc_flag_get(ADC0, ADC_FLAG_EOC);
- adc_srt[3]=adc_flag_get(ADC0, ADC_FLAG_EOC);
- adc_srt_time =rt_tick_get();
- adc_ssys_time=SysTick->VAL ;
- /* ADC software trigger enable */
- adc_flag_clear(ADC0, ADC_FLAG_EOC);
- adc_srt[4]=adc_flag_get(ADC0, ADC_FLAG_EOC);
- adc_software_trigger_enable(ADC0, ADC_INSERTED_CHANNEL);
- adc_srt[1]=0 ;
- while(!adc_flag_get(ADC0, ADC_FLAG_EOC)) {
- adc_srt[1]++ ;
- }
- adc_esys_time=SysTick->VAL ;
- adc_val_1 = ADC_IDATA0(ADC0);
- adc_ert_time=rt_tick_get();
- rt_kprintf(" adc val 1 is start rt_tick_get() :%drn", adc_srt_time);
- rt_kprintf(" adc val 1 is start SysTick->VAL :%drn", adc_ssys_time);
- rt_kprintf(" adc val 1 is ed rt_tick_get() :%drn", adc_ert_time);
- rt_kprintf(" adc val 1 is ed SysTick->VAL :%drn", adc_esys_time);
- rt_kprintf(" adc val 1 is %d 47tickrn", adc_val_1);
- rt_kprintf(" adc_flag_get(ADC0 , ADC_FLAG_EOIC) adc_srt[0]:%d adc_srt[1]:%d adc_srt[3]: adc_srt[4]:%drn",adc_srt[0],adc_srt[1],adc_srt[3],adc_srt[4]);
- adc_srt_time =rt_tick_get();
- adc_ssys_time=SysTick->VAL ;
- rt_kprintf("rn");
- adc_esys_time=SysTick->VAL ;
- adc_ert_time=rt_tick_get();
- rt_kprintf(" rt_kprintf 2chr start rt_tick_get() :%drn", adc_srt_time);
- rt_kprintf(" rt_kprintf start SysTick->VAL :%drn", adc_ssys_time);
- rt_kprintf(" rt_kprintf ed rt_tick_get() :%drn", adc_ert_time);
- rt_kprintf(" rt_kprintf ed SysTick->VAL :%drn", adc_esys_time);
- /* delay a time in milliseconds */
- rt_thread_mdelay(2);
- /* value convert */
- adc_val_1 = ADC_IDATA0(ADC0); //pc3 IN13//24256tick 约203Us
- // adc_val_2 = ADC_IDATA1(ADC0);//PC5 IN15
- adc_flag_clear(ADC0, ADC_FLAG_EOC);
- /* value print */
- rt_kprintf(" adc val 1 is %d 2srn", adc_val_1);
- // printf(" adc val 2 is 0x%xrn", adc_val_2);
- rt_kprintf(" rn");
- rt_thread_mdelay(1);
- adc_srt_time =rt_tick_get();
- adc_ssys_time=SysTick->VAL ;
- rt_thread_mdelay(1);
- adc_esys_time=SysTick->VAL ;
- adc_ert_time=rt_tick_get();
- rt_kprintf(" mdelay(1) is start rt_tick_get() :%drn", adc_srt_time);
- rt_kprintf(" mdelay(1) is start SysTick->VAL :%drn", adc_ssys_time);
- rt_kprintf(" mdelay(1)end is ed rt_tick_get() :%drn", adc_ert_time);
- rt_kprintf("mdelay(1)end is ed SysTick->VAL :%drn", adc_esys_time);//调度1658tick,约13us
- rt_kprintf(" rn");
- rt_thread_mdelay(12500);
- }
- }
- int main(void)
- {
- #define KEY_ON 0 //
- // Button
- Button_2 = 34;//get_pin(34)// 22
- Button_3 = 7;//get_pin(7); 21
- Button_4 = 15;//get_pin(15); 2
- rt_pin_mode(Button_2, PIN_MODE_INPUT_PULLUP);
- rt_pin_mode(Button_3, PIN_MODE_INPUT_PULLUP);
- rt_pin_mode(Button_4, PIN_MODE_INPUT_PULLUP);
- Button_Create("Button3",
- &Button3,
- Read_Button3_Level,
- KEY_ON);
- Button_Attach(&Button3,BUTTON_DOWM,Btn3_Dowm_CallBack); //单击
- Button_Attach(&Button3,BUTTON_DOUBLE,Btn3_Double_CallBack); //双击
- // Button_Attach(&Button3,BUTTON_CONTINUOS,Btn3_Continuos_CallBack); //连按
- // Button_Attach(&Button3,BUTTON_CONTINUOS_FREE,Btn3_ContinuosFree_CallBack); //连按释放
- Button_Attach(&Button3,BUTTON_LONG,Btn3_Long_CallBack); //长按
- Button_Create("Button2",
- &Button2,
- Read_Button2_Level,
- KEY_ON);
- Button_Attach(&Button2,BUTTON_DOWM,Btn2_Dowm_CallBack); //单击
- Button_Attach(&Button2,BUTTON_DOUBLE,Btn2_Double_CallBack); //双击
- // Button_Attach(&Button2,BUTTON_CONTINUOS,Btn2_Continuos_CallBack); //连按
- // Button_Attach(&Button2,BUTTON_CONTINUOS_FREE,Btn2_ContinuosFree_CallBack); //连按释放
- Button_Attach(&Button2,BUTTON_LONG,Btn2_Long_CallBack); //长按
- Button_Create("Button4",
- &Button4,
- Read_Button4_Level,
- KEY_ON);
- Button_Attach(&Button4,BUTTON_DOWM,Btn4_Dowm_CallBack); //单击
- Button_Attach(&Button4,BUTTON_DOUBLE,Btn4_Double_CallBack); //双击
- // Button_Attach(&Button4,BUTTON_CONTINUOS,Btn4_Continuos_CallBack); //连按
- // Button_Attach(&Button4,BUTTON_CONTINUOS_FREE,Btn4_ContinuosFree_CallBack); //连按释放
- Button_Attach(&Button4,BUTTON_LONG,Btn4_Long_CallBack); //长按
- Get_Button_Event(&Button4);
- Get_Button_Event(&Button3);
- Get_Button_Event(&Button2);
- pin_r = 10;//rt_pin_get(10);
- pin_g = 11;//rt_pin_get(11);
- pin_b = 12;//rt_pin_get(12);
- pin_4= 13;//rt_pin_get(13);
- pinout_19= 19;//out_rt_pin_get(19);
- rt_pin_mode(pin_r, PIN_MODE_OUTPUT);
- rt_pin_mode(pin_g, PIN_MODE_OUTPUT);
- rt_pin_mode(pin_b, PIN_MODE_OUTPUT);
- rt_pin_mode(pin_4, PIN_MODE_OUTPUT);
- rt_pin_mode(pinout_19, PIN_MODE_OUTPUT);
- rt_kprintf("Hello, worldn");
- a=1;
- b=1;
- c=1;//pin_rgb不亮
- a_v=5;
- b_v=5;
- c_v=5;//pin_rgb允许
- // _irrx_hw_init();
- pwm_init();
- mind_n_key1 = 0;
- // uint8_t pin_count = 0;
- // while (1)
- // {
- //
- // rt_pin_write(pin_r, pin_count&0x1);
- // rt_pin_write(pin_g,( pin_count>>1)&0x1);
- // rt_pin_write(pin_b, ( pin_count>>2)&0x1);
- // rt_thread_mdelay(50);
- // rt_pin_write(pin_r, 0x1);
- // rt_pin_write(pin_g, 0x1);
- // rt_pin_write(pin_b,0x1);
- // rt_thread_mdelay(500);
- // pin_count++;
- // }
- //adc
- /* system clocks configuration */
- rcu_config();
- /* configure systick */
- //systick_config();
- /* ADC configuration */
- adc_config();
- /* USART configuration */
- //gd_eval_com_init(EVAL_COM1);
- //adc
- //adc
- /* ADC software trigger enable */
- adc_software_trigger_enable(ADC0, ADC_INSERTED_CHANNEL);
- /* delay a time in milliseconds */
- rt_thread_mdelay(20);
- /* value convert */
- adc_srt[0]=SysTick->VAL ;
- temperature =357.55814 - ADC_IDATA0(ADC0)*0.1873637;// 207ticks //(1.43 - ADC_IDATA0(ADC0)*3.3/4096) * 1000 / 4.3 + 25;
- adc_srt[1]=SysTick->VAL ;
- temperature =(1.43 - ADC_IDATA0(ADC0)*3.3/4096) * 1000 / 4.3 + 25;// 560ticks //(1.43 - ADC_IDATA0(ADC0)*3.3/4096) * 1000 / 4.3 + 25;
- adc_srt[2]=SysTick->VAL ;
- vref_value = (ADC_IDATA1(ADC0) * 0.8056640625);//120ticks //3300 / 4096);
- adc_srt[3]=SysTick->VAL ;
- vref_value = (ADC_IDATA1(ADC0) * 3300 / 4096);//34ticks
- adc_srt[4]=SysTick->VAL ;
- rt_kprintf(" temperature start1 %d rn", adc_srt[0]);
- rt_kprintf(" temperature start2 %d rn", adc_srt[1]);
- rt_kprintf(" temperature start3 vref_value :%d rn", adc_srt[2]);
- rt_kprintf(" vref_value start4 %d rn", adc_srt[3]);
- rt_kprintf(" vref_value start5 %d rn", adc_srt[4]);
- /* value print */
- rt_kprintf(" ADC_IDATA0(ADC0) is %d rn", ADC_IDATA0(ADC0));
- rt_kprintf("ADC_IDATA1(ADC0) is %d rn", ADC_IDATA1(ADC0));
- rt_kprintf(" the temperature data is %2.0f degrees Celsiusrn", temperature);
- rt_kprintf(" the reference voltage data is %5.3fmV rn", vref_value);
- // rt_kprintf(" the temperature data is %d.%d degrees Celsius rn", temperature,(int) (temperature*10)%10);//2.0f degrees Celsius
- // rt_kprintf(" the reference voltage data is %d mV rn", vref_value);
- rt_kprintf(" rn");
- //*! disable the temperature sensor and Vrefint channel
- adc_tempsensor_vrefint_disable();
- adc_init1();//pc3
- //adc
- while (1)
- {
- if(bootCount==0x0a55aa00) {
- bootCount=0x0a55aa01; //启动DeepSleep
- // endProducing= clock_cpu_millisecond();
- }
- if(bootCount==0x0a55aa01) {
- rt_kprintf("bootCount:%drn",bootCount);
- rt_thread_mdelay(1);
- rt_kprintf("1.5'start 1,no DF_A. rn");
- rt_thread_mdelay(90000);
- if (rt_thread_find("DF_A")!= RT_NULL)
- {
- rt_kprintf("1.5'end ,yes have DF_A. rn");
- rt_thread_delete(rt_thread_find("DF_A"));
- }
- else
- {
- }
- // if(clock_cpu_millisecond() - endProducing > 90000){
- // xTaskCreate(
- // DF_A,
- // "DF_A", /* String with name of task. */
- // 20000, /* Stack size in words. */
- // NULL, /* Parameter passed as input of the task */
- // 2, /* Priority of the task. */
- // NULL);
- tid_dfa = rt_thread_create( "DF_A", DF_A, RT_NULL, 1024,6, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid_dfa != RT_NULL)
- rt_thread_startup(tid_dfa);
- // _DF_A_hw_init
- // }
- }
- if(mind_n_key1==2) {
- // digitalWrite(OUT_PWM, LOW);
- rt_pin_write(pinout_19,PIN_LOW);
- }
- if(bootCount==1) {
- rt_thread_mdelay(6); //delay(6);
- bootCount=0;
- if (mind_n_key1==0) {
- // xTaskCreate(
- // DF_A,
- // "DF_A", /* String with name of task. */
- // 20000, /* Stack size in words. */
- // NULL, /* Parameter passed as input of the task */
- // 2, /* Priority of the task. */
- // NULL);
- tid_dfa = rt_thread_create( "DF_A", DF_A, RT_NULL, 1024,6, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid_dfa != RT_NULL)
- rt_thread_startup(tid_dfa);
- // _DF_A_hw_init
- }
- if (mind_n_key1==1) {
- // xTaskCreate(
- // DF_B,
- // "DF_B", /* String with name of task. */
- // 10000, /* Stack size in words. */
- // NULL, /* Parameter passed as input of the task */
- // 2, /* Priority of the task. */
- // NULL);
- tid_dfb = rt_thread_create( "DF_B", DF_B, RT_NULL, 1024,6, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid_dfb!= RT_NULL)
- rt_thread_startup(tid_dfb);
- // _DF_A_hw_init
- }
- }
- }
- }
- // 自定义函数
- void DF_B(void * parameter) {
- uint16_t mind_a0_on, mind_a0_on1;
- rt_kprintf("Created task DF_b: Executing on core ");
- // Serial.println(xPortGetCoreID());
- tid_adc_B = rt_thread_create( "adc_B", adc_B, RT_NULL, 1024,7, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid_adc_B != RT_NULL)
- rt_thread_startup(tid_adc_B);
- // _adc_B_hw_init
- rt_thread_mdelay(1000);
- mind_a0_on=adc_val_1;
- rt_thread_delete(tid_adc_B);//任务的删除vTaskDelete( NULL ); //任务的删除
- while (mind_n_key1==1) {
- tid_adc_B = rt_thread_create( "adc_B", adc_B, RT_NULL, 1024,7, 2 );
- /* 如果获得线程控制块,启动这个线程 */
- if (tid_adc_B != RT_NULL)
- rt_thread_startup(tid_adc_B);
- // _adc_B_hw_init
- // for(b=0; b<8; b++) { //检测双击 循环10次200ms
- //// startProducing = ESP.getCycleCount();//开始时间
- //// mind_a0_on1=analogRead(IN_0);
- //// mind_a0_on+=mind_a0_on1;
- //// endProducing = ESP.getCycleCount();//结束时间
- // // Serial.print("mind_a0_on input A0 time all时间(CycleCount): ");
- //// Serial.println(( endProducing - startProducing));//写入耗费时间(CycleCount)
- // // Serial.printf("DF_b(analogRead(IN_0))%d: %d %d n",b,mind_a0_on1,mind_a0_on);//
- // // Serial.println("");
- // }
- DF_onoff(mind_a0_on, 1023, 1);
- mind_a0_on=adc_val_1;
- rt_thread_delete(tid_adc_B);//任务的删除vTaskDelete( NULL ); //任务的删除
- }
- bootCount = 1;
- // Serial.println("删除DF_b");
- // vTaskDelete( NULL ); //任务的删除
- // rt_thread_delete();//任务的删除
- }
- void DF_onoff(uint16_t mind_n_on, uint16_t mind_n_off, uint8_t mind_n_key) {
- rt_kprintf("DF_onoff Cycle Count mind_n_on:%d, uint16_t mind_n_off:%d, uint8_t mind_n_key:%dn",mind_n_on,mind_n_off, mind_n_key);//
- while ((mind_n_off>0)) {
- while ((mind_n_on>0)) {
- rt_pin_write(pinout_19,PIN_HIGH); // digitalWrite(OUT_PWM, HIGH);
- rt_thread_mdelay(6);
- mind_n_off -= 1;
- mind_n_on -= 1;
- if (!(mind_n_key==mind_n_key1)) {
- mind_n_off = 0;
- mind_n_on = 0;
- bootCount = 1;
- }
- }
- if ((mind_n_off>0)) {
- rt_pin_write(pinout_19,PIN_LOW); // digitalWrite(OUT_PWM, LOW);
- rt_thread_mdelay(6); // delay(6);
- mind_n_off -= 1;
- if (!(mind_n_key==mind_n_key1)) {
- mind_n_off = 0;
- mind_n_on = 0;
- bootCount = 1;
- }
- }
- }
- }
- void DF_A(void * parameter) {
- rt_kprintf("Created task DF_A: Executing on core rn");
- // Serial.println(xPortGetCoreID());
- startProducing=rt_tick_get();// = millis();开始时间
- if(bootCount==0x0a55aa01) {
- bootCount = 0;
- uint8_t mind_n_Asn = 80;
- rt_kprintf("DF_A to 50% (8')start Producing time (ms): %d", rt_tick_get() - startProducing);
- //rt_kprintf();//写入耗费时间(ms)
- rt_kprintf(" rn");
- while (!(mind_n_Asn==0)) {
- DF_onoff(500, 1023, 0);
- if (mind_n_key1==0) {
- mind_n_Asn -= 1;
- }
- else {
- bootCount = 1;
- mind_n_Asn = 0;
- }
- }
- }
- else {
- mind_n_As1 = 10;
- while (mind_n_As1>0) {
- DF_onoff(1023, 1023, 0);
- if (mind_n_key1==0) {
- mind_n_As1 -= 1;
- }
- else {
- mind_n_As1 = 0;
- bootCount = 1;
- }
- }
- if (mind_n_key1==0) {
- rt_kprintf("DF_A 1' end time(ms): %d", rt_tick_get() - startProducing);
- // rt_kprintf( rt_tick_get() - startProducing);//写入耗费时间(ms)
- rt_kprintf("start 1.5'continue :");
- rt_kprintf(" rn");
- bootCount=0x0a55aa00; //启动DeepSleep
- rt_kprintf("bootCount:%drn",bootCount);
- rt_thread_mdelay(1);
- rt_kprintf("1.5'start,exit DF_A. rn");
- rt_thread_exit();//delete(tid_dfa);//任务的删除vTaskDelete( NULL ); //任务的删除
- while(1);
- }
- }
- // endProducing = millis();//结束时间
- // Serial.print("Producing time all时间(ms): ");
- // Serial.println(( endProducing - startProducing));//写入耗费时间(ms)
- if (mind_n_key1==0) {
- mind_n_key1 = 2;
- }
- // Serial.println("删除DF_A");
- // vTaskDelete( NULL ); //任务的删除
- }
- /*!
- brief configure the different system clocks
- param[in] none
- param[out] none
- retval none
- */
- void rcu_config(void)
- {
- /* enable ADC clock */
- rcu_periph_clock_enable(RCU_ADC0);
- /* config ADC clock */
- rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV6);
- }
- /*!
- brief configure the ADC peripheral
- param[in] none
- param[out] none
- retval none
- */
- void adc_config(void)
- {
- /* ADC SCAN function enable */
- adc_special_function_config(ADC0,ADC_SCAN_MODE,ENABLE);
- /* ADC trigger config */
- adc_external_trigger_source_config(ADC0, ADC_INSERTED_CHANNEL, ADC0_1_2_EXTTRIG_INSERTED_NONE);
- /* ADC data alignment config */
- adc_data_alignment_config(ADC0,ADC_DATAALIGN_RIGHT);
- /* ADC mode config */
- adc_mode_config(ADC_MODE_FREE);
- /* ADC channel length config */
- adc_channel_length_config(ADC0,ADC_INSERTED_CHANNEL,2);
- /* ADC temperature sensor channel config */
- adc_inserted_channel_config(ADC0, 0, ADC_CHANNEL_16, ADC_SAMPLETIME_239POINT5);
- /* ADC internal reference voltage channel config */
- adc_inserted_channel_config(ADC0, 1, ADC_CHANNEL_17, ADC_SAMPLETIME_239POINT5);
- /* ADC external trigger enable */
- adc_external_trigger_config(ADC0,ADC_INSERTED_CHANNEL,ENABLE);
- /* ADC temperature and Vrefint enable */
- adc_tempsensor_vrefint_enable();
- /* enable ADC interface */
- adc_enable(ADC0);
- rt_thread_mdelay(1);
- /* ADC calibration and reset calibration */
- adc_calibration_enable(ADC0);
- }
- // 事件回调函数
- //宏: [RT_USING_CPUTIME]
- //使能此选项时,BSP 应提供 rt_clock_cputime_ops 为 CPU 时间,通过
- //const static struct rt_clock_cputime_ops _ops = {...};
- //clock_cpu_setops(&_ops);
- //
- //然后开发者能够使用高精度的时钟计数:
- //
- //ts1 = clock_cpu_gettime();
- //ts2 = clock_cpu_gettime();
- //
- ///* and get the ms of delta tick with API: */
- //ms_tick = clock_cpu_millisecond(t2 - t1);
- //us_tick = clock_cpu_microsecond(t2 - t1);
- void adc_init(void)
- {
- adc_disable(ADC0) ;
- //禁用ADC过采样模式
- adc_oversample_mode_disable(ADC0);
- //adc 引脚初始化
- /* 使能 GPIOC clock */
- rcu_periph_clock_enable(RCU_GPIOC);
- /* 设置PC3 引脚为模拟输入 */
- gpio_init(GPIOC, GPIO_MODE_AIN, GPIO_OSPEED_MAX, GPIO_PIN_3 );
- //adc 引脚初始化
- /* 使能ADC0 时钟源 */
- rcu_periph_clock_enable(RCU_ADC0);
- /* 配置预分频 */
- rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV6);
- /* ADC 扫描模式打开 */
- adc_special_function_config(ADC0,ADC_SCAN_MODE,ENABLE);
- /* ADC 触发方式配置 不需要外部触发 */
- adc_external_trigger_source_config(ADC0, ADC_INSERTED_CHANNEL, ADC0_1_2_EXTTRIG_INSERTED_NONE);
- /* 数据右对齐 */
- adc_data_alignment_config(ADC0,ADC_DATAALIGN_RIGHT);
- /* ADC 模式配置,所有ADC独立工作 */
- adc_mode_config(ADC_MODE_FREE);
- /* ADC 转换通道大小配置,2个通道 */
- adc_channel_length_config(ADC0,ADC_INSERTED_CHANNEL,1);
- /* ADC 通道配置 */
- adc_inserted_channel_config(ADC0, 0, ADC_CHANNEL_13, ADC_SAMPLETIME_239POINT5);
- /* ADC 通道配置 */
- //adc_inserted_channel_config(ADC0, 1, ADC_CHANNEL_15, ADC_SAMPLETIME_239POINT5);
- /* ADC 插入组使能 */
- adc_external_trigger_config(ADC0,ADC_INSERTED_CHANNEL,ENABLE);
- /* 使能ADC */
- adc_enable(ADC0);
- rt_thread_mdelay(1);// delay_1ms(1);
- /* ADC 校准 */
- adc_calibration_enable(ADC0);
- // 启用ADC转换 ;
- adc_software_trigger_enable(ADC0, ADC_INSERTED_CHANNEL);
- }
- void adc_init1(void)
- {
- //adc 引脚初始化
- adc_disable(ADC0) ;
- /* 使能 GPIOC clock */
- rcu_periph_clock_enable(RCU_GPIOC);
- /* 设置PC3 引脚为模拟输入 */
- gpio_init(GPIOC, GPIO_MODE_AIN, GPIO_OSPEED_MAX, GPIO_PIN_3 );
- //adc 引脚初始化
- /* 使能ADC0 时钟源 */
- rcu_periph_clock_enable(RCU_ADC0);
- /* 配置预分频 */
- rcu_adc_clock_config(RCU_CKADC_CKAPB2_DIV6);
- /* ADC 扫描模式打开 */
- adc_special_function_config(ADC0,ADC_SCAN_MODE,ENABLE);
- /* ADC 触发方式配置 不需要外部触发 */
- adc_external_trigger_source_config(ADC0, ADC_INSERTED_CHANNEL, ADC0_1_2_EXTTRIG_INSERTED_NONE);
- /* 数据右对齐 */
- adc_data_alignment_config(ADC0,ADC_DATAALIGN_RIGHT);
- /* ADC 模式配置,所有ADC独立工作 */
- adc_mode_config(ADC_MODE_FREE);
- /* ADC 转换通道大小配置,2个通道 */
- adc_channel_length_config(ADC0,ADC_INSERTED_CHANNEL,1);
- /* ADC 通道配置 */
- adc_inserted_channel_config(ADC0, 0, ADC_CHANNEL_13, ADC_SAMPLETIME_239POINT5);
- /* ADC 通道配置 */
- //adc_inserted_channel_config(ADC0, 1, ADC_CHANNEL_15, ADC_SAMPLETIME_239POINT5);
- /* ADC 插入组使能 */
- adc_external_trigger_config(ADC0,ADC_INSERTED_CHANNEL,ENABLE);
- //ADC0、ADCu过采样配置 :一个通道的所有过采样转换在触发后连续完成 6位过采样移位 过采样率倍数16
- adc_oversample_mode_config(ADC0,ADC_OVERSAMPLING_ALL_CONVERT, ADC_OVERSAMPLING_SHIFT_6B, ADC_OVERSAMPLING_RATIO_MUL16);
- /* 使能ADC */
- adc_oversample_mode_enable(ADC0) ;
- adc_enable(ADC0);
- rt_thread_mdelay(1);// delay_1ms(1);
- /* ADC 校准 */
- adc_calibration_enable(ADC0);
- // rt_kprintf(" adc_calibration_enable(ADC0);over in oversamolen");
- // 启用ADC中断 ;
- adc_interrupt_enable(ADC0, ADC_INT_EOC);
- // 启用ADC转换 ;
- adc_software_trigger_enable(ADC0, ADC_INSERTED_CHANNEL);
- }
复制代码
Build started: Project: project
*** Using Compiler 'V5.06 update 6 (build 750)', folder: 'g:Keil_v5 ARMARMCCBin'
Build target 'rt-thread_gd32f30x'
compiling main.c...
applicationsmain.c(680): warning: #177-D: variable "mind_a0_on1" was declared but never referenced
uint16_t mind_a0_on, mind_a0_on1;
applicationsmain.c(811): warning: #223-D: function "rt_thread_exit" declared implicitly
rt_thread_exit();//delete(tid_dfa);//浠诲姟鐨勫垹闄TaskDelete( NULL ); //浠诲姟鐨勫垹闄?
applicationsmain.c: 2 warnings, 0 errors
linking...
Program Size: Code=109108 RO-data=11756 RW-data=1008 ZI-data=5464
After Build - User command #1: fromelf --bin .buildrtthread-gd32f30x.axf --output rtthread.bin
".buildrtthread-gd32f30x.axf" - 0 Error(s), 2 Warning(s).
Build Time Elapsed: 00:00:01
下载:
Load "C:\rt-thread\bsp\gd32303e-eval\build\rtthread-gd32f30x.axf"
Dll Verison 1.06 Build date: 2019-06-23
Emulaor: -LINK, SN: 0023557, Hardware: A, Firmware: 1.23
Manufacturer: , Date: 2020-01-08
Appliaction: -LINK, Version: 1.51
Connect Mode SWD, Speed Auto
Out put voltage 3.33V, current 0.00mA, target voltage 3.34V
Found SWD-DP with ID 0x410FC241
TPIU fitted.
ETM fitted.
Found Cortex-M4 , Little endian
FPUnit: 6 code (BP) slots and 2 literal slots
Data Watchpoint: 4
Erase Done.
Programming Done.
Verify OK.
Flash Load finished at 10:57:28
运行
com口信息:
- | /
- - RT - Thread Operating System
- / | 4.0.3 build Nov 3 2021
- 2006 - 2020 Copyright by rt-thread team
- [32m[I/I2C] I2C bus [i2c0] registered[0m
- Hello, world
- Created task DF_A: Executing on core
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- msh /> temperature start1 116646
- temperature start2 116439
- temperature start3 vref_value :115868
- vref_value start4 115748
- vref_value start5 115714
- ADC_IDATA0(ADC0) is 1815
- ADC_IDATA1(ADC0) is 1490
- the temperature data is 17 degrees Celsius
- the reference voltage data is 1200.000mV
-
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:1023, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_A 1' end time(ms): 61451start 1.5'continue :
- bootCount:173386240
- boot1.5'start,exit DF_A.
- start,exit DF_A. 1.5'start 1,no DF_A.
- Created task DF_A: Executing on core
- DF_A to 50(8')start Producing time (ms): 0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
- DF_onoff Cycle Count mind_n_on:500, uint16_t mind_n_off:1023, uint8_t mind_n_key:0
复制代码
达到预期。
0
|
|
|
|