Skip to content

reading ADC channel : sometimes incorrect readings or old readings  #130

Closed
@paulvha

Description

@paulvha

Error 2 description
sometimes incorrect readings when reading ADC channel

Reproduce
no solid reproduction process, but happening intermittent

root cause
Interrupt reset mask is not initialized before being used
by calling am_hal_adc_interrupt_clear()

Solution
Initialize the interrupt reset mask with 0xff to reset all interrupts

########### in ap3_analog.cpp ################

**************routine analogRead(uint8_t pinNumber) ******************
in the top:

change:
uint32_t ui32IntMask;

To :
uint32_t ui32IntMask = 0xff;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions