Skip to content
Snippets Groups Projects
Commit a31bc4e7 authored by swym's avatar swym
Browse files

use xPoortIsInsideInterrupt instead of raw register access

parent 3ef0e8f6
Branches
No related tags found
No related merge requests found
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "modules/log.h" #include "modules/log.h"
#include "modules/modules.h" #include "modules/modules.h"
#include "api/common.h" #include "api/common.h"
#include "core_cmFunc.h" //__get_IPSR()
#define SSLOG_DEBUG(...) LOG_DEBUG("fatfs", __VA_ARGS__) #define SSLOG_DEBUG(...) LOG_DEBUG("fatfs", __VA_ARGS__)
#define SSLOG_INFO(...) LOG_INFO("fatfs", __VA_ARGS__) #define SSLOG_INFO(...) LOG_INFO("fatfs", __VA_ARGS__)
...@@ -169,11 +168,11 @@ int fatfs_attach() ...@@ -169,11 +168,11 @@ int fatfs_attach()
void fatfs_schedule_attach(void) void fatfs_schedule_attach(void)
{ {
//if we're running in thread context, cont't call the *FromISR version //if we're running in thread context, cont't call the *FromISR version
if (__get_IPSR() == 0) { if (xPortIsInsideInterrupt()) {
xTimerPendFunctionCallFromISR(cb_attachTimer, NULL, 0, NULL);
} else {
xTimerPendFunctionCall( xTimerPendFunctionCall(
cb_attachTimer, NULL, 0, 1); //wait 1 tick cb_attachTimer, NULL, 0, 1); //wait 1 tick
} else {
xTimerPendFunctionCallFromISR(cb_attachTimer, NULL, 0, NULL);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment