NRF5: Enable critical section (#879)

This commit is contained in:
Olivier
2017-06-13 18:49:14 +02:00
committed by Henrik Ekblad
parent 59337b19fe
commit 4820475e5c
2 changed files with 5 additions and 5 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
/*
/*
CircularBuffer - An Arduino circular buffering library for arbitrary types.
Created by Ivo Pullens, Emmission, 2014-2016 -- www.emmission.nl
@@ -88,9 +88,11 @@ public:
*/
inline uint8_t available(void) const
{
uint8_t ret_value;
MY_CRITICAL_SECTION {
return m_fill;
ret_value = m_fill;
}
return ret_value;
}
/**
+1 -3
View File
@@ -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(); \