mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-09-09 23:54:32 +00:00
make sure we are inside process_run() before yielding
This commit is contained in:
parent
69657d579d
commit
df9ece582b
@ -26,7 +26,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id: radio-arch.c,v 1.5 2006/10/05 14:44:43 fros4943 Exp $
|
* $Id: radio-arch.c,v 1.6 2006/10/06 10:45:53 fros4943 Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dev/radio-arch.h"
|
#include "dev/radio-arch.h"
|
||||||
@ -110,7 +110,11 @@ doInterfaceActionsBeforeTick(void)
|
|||||||
static void
|
static void
|
||||||
doInterfaceActionsAfterTick(void)
|
doInterfaceActionsAfterTick(void)
|
||||||
{
|
{
|
||||||
// Nothing to do
|
// Make sure we are awake during radio activity
|
||||||
|
if (simReceiving || simTransmitting) {
|
||||||
|
simDontFallAsleep = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------------------*/
|
||||||
u8_t
|
u8_t
|
||||||
@ -141,7 +145,7 @@ simDoSend(void)
|
|||||||
simOutSize = uip_len;
|
simOutSize = uip_len;
|
||||||
|
|
||||||
// Busy-wait while we are receiving
|
// Busy-wait while we are receiving
|
||||||
while (simReceiving) {
|
if (simReceiving && simInsideProcessRun) {
|
||||||
cooja_mt_yield();
|
cooja_mt_yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +166,7 @@ simDoSend(void)
|
|||||||
simTransmitting = 1;
|
simTransmitting = 1;
|
||||||
|
|
||||||
// Busy-wait while transmitting
|
// Busy-wait while transmitting
|
||||||
while (simTransmitting) {
|
if (simTransmitting && simInsideProcessRun) {
|
||||||
cooja_mt_yield();
|
cooja_mt_yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user