//! [get_res]
uint16_t result;
sio2host_init();
printf("Hello
");
do {
/* Wait for conversion to be done and read out result */
} while (adc_read(&adc_instance, &result) == STATUS_BUSY);
//! [get_res]
printf("Fuck
");
//! [inf_loop]
while (1) {
/* Infinite loop
*/
delay_cycles_ms(5000);
do {
/* Wait for conversion to be done and read out result */
} while (adc_read(&adc_instance, &result) == STATUS_BUSY);
//! [get_res]
printf("%d
",result);
int main(void)
{
system_init();
delay_init();
//! [setup_init]
configure_adc();
//! [setup_init]
//! [main]
//! [start_conv]
adc_start_conversion(&adc_instance);
//! [start_conv]
//! [get_res]
uint16_t result;
sio2host_init();
printf("Hello ");
do {
/* Wait for conversion to be done and read out result */
} while (adc_read(&adc_instance, &result) == STATUS_BUSY);
//! [get_res]
printf("Fuck ");
//! [inf_loop]
while (1) {
/* Infinite loop
*/
delay_cycles_ms(5000);
do {
/* Wait for conversion to be done and read out result */
} while (adc_read(&adc_instance, &result) == STATUS_BUSY);
//! [get_res]
printf("%d ",result);
}
//! [inf_loop]
//! [main]
}
一周热门 更多>