From d5c3bae6cd4229d15ca21ca73cc3ce009ecda6e3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 14 Feb 2016 15:15:37 -0600 Subject: [PATCH] apps/: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() --- examples/buttons/buttons_main.c | 7 ++++--- nshlib/nsh_netcmds.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/buttons/buttons_main.c b/examples/buttons/buttons_main.c index 71fc54ec0..016aa88cb 100644 --- a/examples/buttons/buttons_main.c +++ b/examples/buttons/buttons_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/buttons/buttons_main.c * - * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -52,6 +52,7 @@ #include #include +#include #include /**************************************************************************** @@ -477,7 +478,7 @@ int buttons_main(int argc, char *argv[]) * output from an interrupt handler. */ - flags = irqsave(); + flags = enter_critical_section(); /* Use lowsyslog() for compatibility with interrupt handler * output. @@ -486,7 +487,7 @@ int buttons_main(int argc, char *argv[]) lowsyslog(LOG_INFO, "POLL SET:%02x:\n", newset); show_buttons(g_oldset, newset); g_oldset = newset; - irqrestore(flags); + leave_critical_section(flags); } /* Sleep a little... but not long. This will determine how fast we diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index 224647690..956b3c88c 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -70,6 +70,7 @@ #include #include +#include #include #include #include @@ -174,9 +175,9 @@ static uint16_t g_pingid = 0; #if defined(HAVE_PING) || defined(HAVE_PING6) static uint16_t ping_newid(void) { - irqstate_t save = irqsave(); + irqstate_t save = enter_critical_section(); uint16_t ret = ++g_pingid; - irqrestore(save); + leave_critical_section(save); return ret; } #endif /* HAVE_PING || HAVE_PINg */