Skip to content

Commit

Permalink
Replace using namespace in headers with explicit namespaces.
Browse files Browse the repository at this point in the history
As part of:
lancaster-university/codal-microbit-v2#240

Other targets should also apply patches like
bdfa1ec to ensure they don't
depend on the header files having the `using namespace codal`
line.`
  • Loading branch information
carlosperate committed Jul 23, 2024
1 parent 1529c3f commit d38e3e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions inc/NRF52ADC.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,14 @@ DEALINGS IN THE SOFTWARE.
//
#define NRF52_ADC_DATA_READY 1


using namespace codal;

//
// NRF52ADCChannel status codes
//
#define NRF52_ADC_CHANNEL_STATUS_ENABLED 0x10
#define NRF52_ADC_CHANNEL_STATUS_CONNECTED 0x20

namespace codal
{
class NRF52ADC;

class NRF52ADCChannel : public DataSource
Expand Down Expand Up @@ -350,5 +349,6 @@ class NRF52ADC : public CodalComponent, public PinPeripheral
*/
void configureSampling();
};
} // namespace codal

#endif
4 changes: 3 additions & 1 deletion inc/NRF52PDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ DEALINGS IN THE SOFTWARE.
//
#define NRF52_PDM_BUFFER_SIZE 512

using namespace codal;
namespace codal
{

class NRF52PDM : public CodalComponent, public DataSource
{
Expand Down Expand Up @@ -103,5 +104,6 @@ class NRF52PDM : public CodalComponent, public DataSource

void startDMA();
};
} // namespace codal

#endif
6 changes: 3 additions & 3 deletions inc/NRF52PWM.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
#define NRF52PWM_PWM_PERIPHERALS 3
#define NRF52PWM_PWM_CHANNELS 4


using namespace codal;

namespace codal
{
class NRF52PWM : public CodalComponent, public DataSink, public PinPeripheral
{

Expand Down Expand Up @@ -153,5 +152,6 @@ class NRF52PWM : public CodalComponent, public DataSink, public PinPeripheral
int tryPull(uint8_t b);

};
} // namespace codal

#endif

0 comments on commit d38e3e9

Please sign in to comment.