mirror of
https://github.com/eddyem/mmpp.git
synced 2026-03-20 16:51:06 +03:00
start documentation writing
This commit is contained in:
@@ -48,7 +48,7 @@ void adc_setup(){
|
||||
/* (3) Wait HSI14 is ready */
|
||||
RCC->APB2ENR |= RCC_APB2ENR_ADC1EN; /* (1) */
|
||||
RCC->CR2 |= RCC_CR2_HSI14ON; /* (2) */
|
||||
while ((RCC->CR2 & RCC_CR2_HSI14RDY) == 0) /* (3) */
|
||||
while ((RCC->CR2 & RCC_CR2_HSI14RDY) == 0){}; /* (3) */
|
||||
/* (1) Ensure that ADEN = 0 */
|
||||
/* (2) Clear ADEN */
|
||||
/* (3) Launch the calibration by setting ADCAL */
|
||||
@@ -62,7 +62,7 @@ void adc_setup(){
|
||||
/* (2) Wait until ADC ready */
|
||||
do{
|
||||
ADC1->CR |= ADC_CR_ADEN; /* (1) */
|
||||
}while ((ADC1->ISR & ADC_ISR_ADRDY) == 0) /* (2) */;
|
||||
}while ((ADC1->ISR & ADC_ISR_ADRDY) == 0); /* (2) */;
|
||||
/* (1) Select HSI14 by writing 00 in CKMODE (reset value) */
|
||||
/* (2) Select the continuous mode */
|
||||
/* (3) Select CHSEL0..3, 16,17 */
|
||||
|
||||
@@ -119,7 +119,7 @@ int main(void){
|
||||
//def EBUG
|
||||
if(msgctr > Tms || Tms - msgctr > 4999){ // once per 5 seconds
|
||||
msgctr = Tms;
|
||||
txt = "hello";
|
||||
txt = "hello, I'm alive!\n";
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
|
||||
@@ -338,15 +338,16 @@ static char *set_something(char *str){
|
||||
return setDevId(str);
|
||||
break;
|
||||
case 'M': // set maxsteps
|
||||
setmotvals('M', str);
|
||||
return setmotvals('M', str);
|
||||
break;
|
||||
case 'P': // set pullup
|
||||
omitwsp(str);
|
||||
if(*str == '0') the_conf.intpullup = 0;
|
||||
else the_conf.intpullup = 1;
|
||||
return ALLOK;
|
||||
break;
|
||||
case 'R': // set reverse
|
||||
setmotvals('R', str);
|
||||
return setmotvals('R', str);
|
||||
break;
|
||||
case 'S': // set speed
|
||||
return setMotSpeed(0, str);
|
||||
|
||||
Binary file not shown.
@@ -79,7 +79,7 @@ void USART1_config(){
|
||||
/* Configure USART1 */
|
||||
/* (1) oversampling by 16, set speed */
|
||||
/* (2) 8 data bit, 1 start bit, 1 stop bit, no parity */
|
||||
USART1->BRR = 48000000 / the_conf.usartspd; /* (1) */
|
||||
USART1->BRR = 48000000UL / the_conf.usartspd; /* (1) */
|
||||
USART1->CR1 = USART_CR1_TE | USART_CR1_RE | USART_CR1_UE; /* (2) */
|
||||
/* polling idle frame Transmission */
|
||||
while(!(USART1->ISR & USART_ISR_TC)){}
|
||||
|
||||
Reference in New Issue
Block a user