mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-22 17:43:44 +00:00
Fixed ADC 2 channel mode input selection
This commit is contained in:
parent
114650a439
commit
8b426ee9e5
Software/waveview/scope_link/src
@ -257,7 +257,12 @@ void PCIeLink::Write(ScopeCommand command, void* val) {
|
||||
uint8_t course_gain12[] = {0xFD,0x2B,0x0A,0xAA};
|
||||
_FIFO_WRITE(user_handle,course_gain12,4);
|
||||
//Set adc into active mode
|
||||
_ch_on(0);
|
||||
currentBoardState.num_ch_on++;
|
||||
currentBoardState.ch_is_on[0] = true;
|
||||
_FIFO_WRITE(user_handle,currentBoardState.adc_chnum_clkdiv,sizeof(currentBoardState.adc_chnum_clkdiv));
|
||||
_adc_active();
|
||||
_FIFO_WRITE(user_handle,currentBoardState.adc_in_sel_12,sizeof(currentBoardState.adc_in_sel_12));
|
||||
_FIFO_WRITE(user_handle,currentBoardState.adc_in_sel_34,sizeof(currentBoardState.adc_in_sel_34));
|
||||
}
|
||||
|
||||
INFO << "Enabling the front end";
|
||||
@ -852,12 +857,10 @@ int PCIeLink::_adc_ch_cfg(){
|
||||
currentBoardState.adc_chnum_clkdiv[2] = 0x01;
|
||||
|
||||
for (i=0; !currentBoardState.ch_is_on[i]; i++); //Find first on channel
|
||||
|
||||
currentBoardState.adc_in_sel_12[3] = (2 << i); //Set 2 ADCs to sample first channel
|
||||
currentBoardState.adc_in_sel_12[2] = (2 << i);
|
||||
|
||||
i++;
|
||||
for (; !currentBoardState.ch_is_on[i]; i++); //Find second on channel
|
||||
|
||||
currentBoardState.adc_in_sel_34[3] = (2 << i); //Set 2 ADCs to sample second channel
|
||||
currentBoardState.adc_in_sel_34[2] = (2 << i);
|
||||
|
||||
|
@ -297,6 +297,9 @@ void controller::controllerLoop()
|
||||
if(chCount == 1 || chCount == 2 || chCount == 4) {
|
||||
setCh(chCount);
|
||||
}
|
||||
else if (chCount == 3){
|
||||
setCh(4);
|
||||
}
|
||||
else {
|
||||
ERROR << "Bad chCount for SetCh";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user