Skip to content

Commit

Permalink
Update ecADC2_student.c
Browse files Browse the repository at this point in the history
  • Loading branch information
JarryGoon authored Oct 29, 2024
1 parent 74064eb commit dfd613b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/lib-student/ecADC2_student.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ void JADC_sequence(PinName_t *seqCHn, int seqCHnums){
ADC1->JSQR |= (seqCHnums-1) << ADC_JSQR_JL_Pos; // conversions in the regular channel conversion sequence

for(int i = 0; i<seqCHnums; i++){
ADC1->JSQR &= ~(0x1F<<(15 - 5 * i)); // SQ1 clear bits
ADC1->JSQR |= chN[i]<<(15 - 5 * i); // Choose the channel to convert sequence
ADC1->JSQR &= ~(0x1F<<(15 - 5 * (seqCHnums - i - 1))); // SQ1 clear bits
ADC1->JSQR |= chN[i]<<(15 - 5 * (seqCHnums - i - 1)); // Choose the channel to convert sequence
//ADC1->JSQR &= ~(0x1FUL << i*5);
//ADC1->JSQR |= chN[i] << i*5;
}
Expand Down

0 comments on commit dfd613b

Please sign in to comment.