Skip to content

Commit

Permalink
Ensure all .cpp files have using namespace codal. (lancaster-univer…
Browse files Browse the repository at this point in the history
…sity#54)

As part of:
lancaster-university/codal-microbit-v2#240

Cannot remove all header files usage of `using namesapce` yet as
that will affect other CODAL targets that might not have apply
this type of patch yet.
  • Loading branch information
carlosperate authored Jul 22, 2024
1 parent 62da916 commit bdfa1ec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions source/NRF52ADC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ DEALINGS IN THE SOFTWARE.
#include "nrf.h"
#include "cmsis.h"

using namespace codal;

// Calculation to determine the optimal usable space for a DMA buffer for the given number of channels
#define NRF52ADC_DMA_ALIGNED_SIZED(c) ((bufferSize - (bufferSize % (c * 2 * softwareOversample)))/2);

Expand Down
2 changes: 2 additions & 0 deletions source/NRF52PDM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ DEALINGS IN THE SOFTWARE.
#include "NRF52PDM.h"
#include "nrf.h"

using namespace codal;

// Handle on the last (and probably only) instance of this class (NRF52 has only one PDM module)
static NRF52PDM *nrf52_pdm_driver = NULL;

Expand Down
2 changes: 2 additions & 0 deletions source/NRF52PWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "nrf.h"
#include "cmsis.h"

using namespace codal;

#define NRF52PWM_EMPTY_BUFFERSIZE 8
static uint16_t emptyBuffer[NRF52PWM_EMPTY_BUFFERSIZE];

Expand Down
4 changes: 3 additions & 1 deletion source/neopixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "neopixel.h"

using namespace codal;

#if CONFIG_ENABLED(HARDWARE_NEOPIXEL)

void neopixel_send_buffer(Pin &pin, const uint8_t *ptr, int numBytes)
Expand Down Expand Up @@ -88,5 +90,5 @@ __attribute__((noinline)) void neopixel_send_buffer(Pin &pin, const uint8_t *ptr

void neopixel_send_buffer(Pin &pin, ManagedBuffer buffer)
{
neopixel_send_buffer(pin, &buffer[0], buffer.length());
codal::neopixel_send_buffer(pin, &buffer[0], buffer.length());
}

0 comments on commit bdfa1ec

Please sign in to comment.