diff --git a/inc/NRF52ADC.h b/inc/NRF52ADC.h index 9def83c..44e0a0e 100644 --- a/inc/NRF52ADC.h +++ b/inc/NRF52ADC.h @@ -42,8 +42,12 @@ DEALINGS IN THE SOFTWARE. // #define NRF52_ADC_DATA_READY 1 - +// This "using namespace codal" cannot be removed from this header file without +// breaking targets where some .cpp files depend on it. So this config flag is +// enabled by default and keeps the namespace for compatibility. +#if CONFIG_ENABLED(CODAL_USE_GLOBAL_NAMESPACE) using namespace codal; +#endif // // NRF52ADCChannel status codes @@ -51,6 +55,8 @@ using namespace codal; #define NRF52_ADC_CHANNEL_STATUS_ENABLED 0x10 #define NRF52_ADC_CHANNEL_STATUS_CONNECTED 0x20 +namespace codal +{ class NRF52ADC; class NRF52ADCChannel : public DataSource @@ -350,5 +356,6 @@ class NRF52ADC : public CodalComponent, public PinPeripheral */ void configureSampling(); }; +} // namespace codal #endif diff --git a/inc/NRF52PDM.h b/inc/NRF52PDM.h index 691cfdc..eba7fb7 100755 --- a/inc/NRF52PDM.h +++ b/inc/NRF52PDM.h @@ -40,7 +40,15 @@ DEALINGS IN THE SOFTWARE. // #define NRF52_PDM_BUFFER_SIZE 512 +// This "using namespace codal" cannot be removed from this header file without +// breaking targets where some .cpp files depend on it. So this config flag is +// enabled by default and keeps the namespace for compatibility. +#if CONFIG_ENABLED(CODAL_USE_GLOBAL_NAMESPACE) using namespace codal; +#endif + +namespace codal +{ class NRF52PDM : public CodalComponent, public DataSource { @@ -103,5 +111,6 @@ class NRF52PDM : public CodalComponent, public DataSource void startDMA(); }; +} // namespace codal #endif diff --git a/inc/NRF52PWM.h b/inc/NRF52PWM.h index 946aa6c..362197e 100755 --- a/inc/NRF52PWM.h +++ b/inc/NRF52PWM.h @@ -15,9 +15,15 @@ #define NRF52PWM_PWM_PERIPHERALS 3 #define NRF52PWM_PWM_CHANNELS 4 - +// This "using namespace codal" cannot be removed from this header file without +// breaking targets where some .cpp files depend on it. So this config flag is +// enabled by default and keeps the namespace for compatibility. +#if CONFIG_ENABLED(CODAL_USE_GLOBAL_NAMESPACE) using namespace codal; +#endif +namespace codal +{ class NRF52PWM : public CodalComponent, public DataSink, public PinPeripheral { @@ -153,5 +159,6 @@ class NRF52PWM : public CodalComponent, public DataSink, public PinPeripheral int tryPull(uint8_t b); }; +} // namespace codal #endif