File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
24
*/
25
25
#include " sfeToolkit.h"
26
26
27
+ // THIS IS A PLACEHOLDER FILE for now
28
+ #ifdef ARDUINO
29
+ #include < Arduino.h>
30
+ #endif
27
31
// ---------------------------------------------------------------------------------
28
32
/* *
29
33
* @brief C function - Runtime check for system byte order
@@ -69,3 +73,26 @@ uint32_t sfeToolkit::byte_swap(uint32_t i)
69
73
return ((i << 24 ) & 0xff000000 ) | ((i << 8 ) & 0x00ff0000 ) | ((i >> 8 ) & 0x0000ff00 ) | ((i >> 24 ) & 0x000000ff );
70
74
#endif
71
75
}
76
+
77
+ void sfeToolkit::delay_ms (uint32_t ms)
78
+ {
79
+ // right now we use the Arduino delay function - future we need to abstract out a driver
80
+
81
+ #if defined(ARDUINO)
82
+ delay (ms);
83
+ #else
84
+ #error // we need to implement a delay function
85
+ // we need to implement a delay function
86
+ #endif
87
+ }
88
+
89
+ uint32_t sfeToolkit::ticks_ms (void )
90
+ {
91
+ #if defined(ARDUINO)
92
+ return millis ();
93
+ #else
94
+ #error // we need to implement a delay function
95
+ // we need to implement a delay function
96
+ #endif
97
+ return 0 ;
98
+ }
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33
33
@brief Common include file for the core of the SparkFun Electronics Toolkit
34
34
*/
35
35
#include " sfeTkError.h"
36
+ #include " sfeTkIBus.h"
36
37
37
38
// byte order types/enum
38
39
enum class sfeTKByteOrder : uint8_t
@@ -51,4 +52,7 @@ uint8_t byte_swap(uint8_t i);
51
52
uint16_t byte_swap (uint16_t i);
52
53
uint32_t byte_swap (uint32_t i);
53
54
55
+ void delay_ms (uint32_t ms);
56
+ uint32_t ticks_ms (void );
57
+
54
58
}; // namespace sfeToolkit
You can’t perform that action at this time.
0 commit comments