Skip to content

Commit 80cec79

Browse files
EricB-ADIpetejohanson-adi
authored andcommitted
REV A ADC Driver Fix (#426)
* fixed casting error in MXC_ADC_RevA_StartConversion --------- Co-authored-by: EricB-ADI <[email protected]> MSDK-Commit: 12eeaebad8408db085b2909073dedd354603b46f
1 parent 9bb5b8c commit 80cec79

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

MAX/Libraries/PeriphDrivers/Source/ADC/adc_reva.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ void MXC_ADC_RevA_DisableMonitorAsync(mxc_adc_monitor_t monitor)
327327

328328
int MXC_ADC_RevA_StartConversion(mxc_adc_reva_regs_t *adc, mxc_adc_chsel_t channel)
329329
{
330-
int data;
330+
uint16_t data;
331+
331332
int error;
332333
#if TARGET_NUM != 32650
333334
if (channel > AIN16) {
@@ -352,11 +353,11 @@ int MXC_ADC_RevA_StartConversion(mxc_adc_reva_regs_t *adc, mxc_adc_chsel_t chann
352353

353354
while (adc->status & MXC_F_ADC_REVA_STATUS_ACTIVE) {}
354355

355-
if ((error = MXC_ADC_GetData((uint16_t *)&data)) != E_NO_ERROR) {
356+
if ((error = MXC_ADC_GetData(&data)) != E_NO_ERROR) {
356357
return error;
357358
}
358359

359-
return data;
360+
return (int)data;
360361
}
361362

362363
int MXC_ADC_RevA_StartConversionAsync(mxc_adc_reva_regs_t *adc, mxc_adc_chsel_t channel,

0 commit comments

Comments
 (0)