Skip to content

Commit 353fc38

Browse files
authored
Merge pull request #41 from sparkfun/feature/naming-change
Feature/naming change
2 parents 7f152ff + 09c3f2d commit 353fc38

18 files changed

+605
-734
lines changed

src/SparkFun_Toolkit.h

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
2-
/*
3-
SparkFun_Toolkit.h
4-
5-
The MIT License (MIT)
6-
7-
Copyright (c) 2023 SparkFun Electronics
8-
9-
Permission is hereby granted, free of charge, to any person obtaining a
10-
copy of this software and associated documentation files (the "Software"),
11-
to deal in the Software without restriction, including without limitation
12-
the rights to use, copy, modify, merge, publish, distribute, sublicense,
13-
and/or sell copies of the Software, and to permit persons to whom the
14-
Software is furnished to do so, subject to the following conditions: The
15-
above copyright notice and this permission notice shall be included in all
16-
copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
17-
"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
18-
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19-
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21-
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23-
24-
*/
1+
/**
2+
* @file SparkFun_Toolkit.h
3+
* @brief Arduino style header file for the SparkFun Toolkit
4+
*
5+
* This file contains the Arduino style header for the SparkFun Toolkit library
6+
*
7+
* @author SparkFun Electronics
8+
* @date 2024-2025
9+
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc. This project is released under the MIT License.
10+
*
11+
* SPDX-License-Identifier: MIT
12+
*/
2513

2614
#pragma once
2715

@@ -31,6 +19,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3119
// Arduino Libraries.
3220

3321
// Just include the toolkit headers
34-
#include "sfeTkArdI2C.h"
35-
#include "sfeTkArdSPI.h"
36-
#include "sfeTkArduino.h"
22+
#include "sfTkArdI2C.h"
23+
#include "sfTkArdSPI.h"
24+
#include "sfTkArduino.h"

src/sfTk/sfTkError.h

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/**
2+
* @file sfTkError.h
3+
* @brief Header file for the SparkFun Toolkit - Base Error Code defines.
4+
*
5+
* This file contains the base error code definitions for the SparkFun Toolkit library.
6+
*
7+
* @author SparkFun Electronics
8+
* @date 2024-2025
9+
* @copyright Copyright (c) 2024-2025, SparkFun Electronics Inc. This project is released under the MIT License.
10+
*
11+
* SPDX-License-Identifier: MIT
12+
*/
13+
14+
15+
#pragma once
16+
17+
#include <stdint.h>
18+
19+
/**
20+
* General Concept
21+
* A SparkFun Toolkit error system. The goal is to keep this simple.
22+
*
23+
* This mimics a variety of systems, using an int type for error codes,
24+
* where:
25+
* 0 = okay
26+
* -1 = general failure
27+
* >0 = an informative error
28+
*
29+
* Since *subsystems* in the toolkit can have their own errors,
30+
* A start range for these errors are defined. Values > than this value
31+
* define the errors for the set subsystem. These start ranges are set
32+
* in this file, with actual error values defined in the the respective
33+
* subsystem header files.
34+
*
35+
*/
36+
typedef int32_t sfTkError_t;
37+
38+
// General errors
39+
40+
/**
41+
* @brief General error code for a failure. Note all errors are negative.
42+
*/
43+
const sfTkError_t ksfTkErrFail = -1; // general fail
44+
/**
45+
* @brief The error code value for success. This is always 0.
46+
*/
47+
const sfTkError_t ksfTkErrOk = 0; // success
48+
49+
/**
50+
* @brief A base value for bus errors. All bus errors are greater than this value, in the 1000 range
51+
*/
52+
const sfTkError_t ksfTkErrBaseBus = 0x1000;

0 commit comments

Comments
 (0)