< div class = "字段field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >论坛:,< / div > < div class = "字段条目" > < div class =”field-item甚至“rel = " sioc: has_container " > < a href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件”“=“sioc:容器sioc:论坛”属性= " rdfs: label skos: prefLabel”数据类型= " " >对话框Smartbond蓝牙低能量-软件< / > < / div > < / div > < / div > < div class =”字段field-name-body field-type-text-with-summary field-label-hidden”> < div class = "字段条目" > < div class =”field-item甚至“财产=“内容:编码”> < p >你好,< / p > < p >我写了一个代码示例P00 P01,P02 ADC值。< / p > < p >这段代码是由codless + TMRSTART = 0, 0, 1 < / p > < p >代码看起来像:< / p > < p > else if (user_compare_cmd(“TMRSTART”、3、3)< br / > {< / p > < p > uint8_t timer_id = ahtoi ((char *) argument_array [0]); < br / > uint8_t指数= ahtoi ((char *) argument_array [1]); < br / > times_seconds = ahtoi ((char *) argument_array [2]); < / p > < p >如果(指数= = 0)< br / >codeless_env。Tmr [timer_id] = app_easy_timer(ahtoi((char*)argument_array[2]),throw_command0);
else if(index == 1)
codeless_env;Tmr [timer_id] = app_easy_timer(ahtoi((char*)argument_array[2]),throw_command1);
else
user_reply(tempstr, false);4) < br / > user_reply (tempstr,真);< / p > < p > / /输入插脚< br / > GPIO_ConfigurePin ((GPIO_PORT) 0, 0 (GPIO_PIN),输入,PID_GPIO, false), < br / > GPIO_ConfigurePin ((GPIO_PORT) 0 (GPIO_PIN) 1,输入,PID_GPIO, false), < br / > GPIO_ConfigurePin ((GPIO_PORT) 0 (GPIO_PIN) 2输入,PID_GPIO, false), < / p > < p > / / ADC INIT < / p > < p > adc_init (GP_ADC_SE 0
} ,并且在回调代码中:
void throw_command0()
{
codeless_env。
int length = (int)(ADC_values_1) / sizeof(ADC_values_1); i < length; i++ ){
adc_enable_channel(0);
adc_get_sample();
ADC_values_1[i] = adc_get_sample();
adc_enable_channel(1);
adc_get_sample();
ADC_values_2[i] = adc_get_sample();
adc_enable_channel(2);
adc_get_sample();
ADC_values_3[i] = adc_get_sample();
}
for(int i = 0; i < length; i++ ){
arch_printf("%i,%i,%i\r\n",ADC_values_1[i],ADC_values_2[i],ADC_values_3[i]);
}
codeless_env.tmr[0] = app_easy_timer(times_seconds,throw_command0);
codeless_env.suppress_response = false;
}
The Timer restarts itself in the callback function.
It works fine for a periode of time and the the program crashes.
The arrays are global defined:
int ADC_value_1[30];
if i debug it with IDE Keil and run it may the storage will be full or the adc stops working?
Any ideas where the problem occures?
arch_printf() caused the problem!
Best regards
Gert