Skip to content

Commit

Permalink
NRF5: Enable critical section (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
tekka007 authored and henrikekblad committed Jun 13, 2017
1 parent 59337b1 commit 4820475
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions drivers/CircularBuffer/CircularBuffer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
CircularBuffer - An Arduino circular buffering library for arbitrary types.
Created by Ivo Pullens, Emmission, 2014-2016 -- www.emmission.nl
Expand Down Expand Up @@ -88,9 +88,11 @@ template <class T> class CircularBuffer
*/
inline uint8_t available(void) const
{
uint8_t ret_value;
MY_CRITICAL_SECTION {
return m_fill;
ret_value = m_fill;
}
return ret_value;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions hal/architecture/MyHwNRF5.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ typedef struct {
} nrf_ecb_t;

#ifndef DOXYGEN
#define MY_CRITICAL_SECTION
// temp. commented, to fix "CircularBuffer.h:94:2: warning: control reaches end of non-void function" error
#define __MY_CRITICAL_SECTION \
#define MY_CRITICAL_SECTION \
for (uint32_t __savePriMask \
__attribute__((__cleanup__(__priMaskRestore))) = __get_PRIMASK(), \
__ToDo = __disableIntsRetVal(); \
Expand Down

0 comments on commit 4820475

Please sign in to comment.