Soldered SD Card Arduino Library
1.0.0
Easily read and write files to and form the SD card breakout! A fork of the original SDFat library by Bill Greiman.
Loading...
Searching...
No Matches
SysCall.h
Go to the documentation of this file.
1
29
#ifndef SysCall_h
30
#define SysCall_h
31
#include "../SdFatConfig.h"
32
#include <stddef.h>
33
#include <stdint.h>
34
#if __cplusplus < 201103
35
#warning nullptr defined
37
#define nullptr NULL
38
#endif
// __cplusplus < 201103
39
//------------------------------------------------------------------------------
41
typedef
uint16_t
SdMillis_t
;
42
//------------------------------------------------------------------------------
47
class
SysCall
48
{
49
public
:
51
static
SdMillis_t
curTimeMS
();
53
static
void
halt
()
54
{
55
while
(1)
56
{
57
yield
();
58
}
59
}
61
static
void
yield
();
62
};
63
#if ENABLE_ARDUINO_FEATURES
64
#if defined(ARDUINO)
66
typedef
Print
print_t
;
68
typedef
Stream
stream_t
;
69
#else
// defined(ARDUINO)
70
#error "Unknown system"
71
#endif
// defined(ARDUINO)
72
//------------------------------------------------------------------------------
73
#ifndef F
75
#define F(str) (str)
76
#endif
// F
77
//------------------------------------------------------------------------------
79
inline
SdMillis_t
SysCall::curTimeMS
()
80
{
81
return
millis();
82
}
83
//------------------------------------------------------------------------------
84
#if defined(PLATFORM_ID)
// Only defined if a Particle device
85
inline
void
SysCall::yield
()
86
{
87
// Recommended to only call Particle.process() if system threading is disabled
88
if
(system_thread_get_state(NULL) == spark::feature::DISABLED)
89
{
90
Particle.process();
91
}
92
}
93
#elif defined(ARDUINO)
94
inline
void
SysCall::yield
()
95
{
96
// Use the external Arduino yield() function.
97
::yield
();
98
}
99
#else
// defined(PLATFORM_ID)
100
inline
void
SysCall::yield
()
101
{
102
}
103
#endif
// defined(PLATFORM_ID)
104
//------------------------------------------------------------------------------
105
#else
// ENABLE_ARDUINO_FEATURES
106
#error Print not defined
107
#include "PrintBasic.h"
109
typedef
PrintBasic
print_t
;
111
typedef
PrintBasic
stream_t
;
112
inline
void
SysCall::yield
()
113
{
114
}
115
#endif
// ENABLE_ARDUINO_FEATURES
116
#endif
// SysCall_h
SdMillis_t
uint16_t SdMillis_t
Definition
SysCall.h:41
print_t
Print print_t
Definition
SysCall.h:66
stream_t
Stream stream_t
Definition
SysCall.h:68
SysCall
SysCall - Class to wrap system calls.
Definition
SysCall.h:48
SysCall::yield
static void yield()
Definition
SysCall.h:85
SysCall::halt
static void halt()
Definition
SysCall.h:53
SysCall::curTimeMS
static SdMillis_t curTimeMS()
Definition
SysCall.h:79
src
common
SysCall.h
Generated on Sun Aug 20 2023 21:57:40 for Soldered SD Card Arduino Library by
1.9.7. Dark theme by
Tilen Majerle
. All rights reserved. Copyright:
Soldered