Skip to content

Commit

Permalink
Updated the ADC channels to use the new requirements for stream API c…
Browse files Browse the repository at this point in the history
…lasses
  • Loading branch information
JohnVidler committed May 17, 2023
1 parent 5fa1d16 commit 76dbf90
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/NRF52ADC.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ class NRF52ADCChannel : public DataSource
*/
virtual void connect(DataSink &component);

/**
* Determines if this source is connected to a downstream component
*
* @return true If a downstream is connected
* @return false If a downstream is not connected
*/
bool isConnected();

/**
* Determine the data format of the buffers streamed out of this component.
*/
Expand Down
5 changes: 5 additions & 0 deletions source/NRF52ADC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ void NRF52ADCChannel::connect(DataSink& component)
this->status |= NRF52_ADC_CHANNEL_STATUS_CONNECTED;
}

bool NRF52ADCChannel::isConnected()
{
return this->status & NRF52_ADC_CHANNEL_STATUS_CONNECTED;
}

/**
* Provide the next available ManagedBuffer to our downstream caller, if available.
*/
Expand Down

0 comments on commit 76dbf90

Please sign in to comment.