Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change SparkFun_APDS9960 to submodule #2800

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@
path = Sming/Libraries/SolarCalculator
url = https://github.com/mikee47/SolarCalculator
ignore = dirty
[submodule "Libraries.SparkFun_APDS9960"]
path = Sming/Libraries/SparkFun_APDS9960
url = https://github.com/sparkfun/SparkFun_APDS-9960_Sensor_Arduino_Library
ignore = dirty
[submodule "Libraries.spiffs"]
path = Sming/Libraries/Spiffs/spiffs
url = https://github.com/pellepl/spiffs.git
Expand Down
29 changes: 29 additions & 0 deletions Sming/Libraries/.patches/SparkFun_APDS9960.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/src/SparkFun_APDS9960.cpp b/src/SparkFun_APDS9960.cpp
index 530c1f6..25968d0 100644
--- a/src/SparkFun_APDS9960.cpp
+++ b/src/SparkFun_APDS9960.cpp
@@ -163,7 +163,7 @@ bool SparkFun_APDS9960::init()
return false;
}

-#if 0
+#if DEBUG
/* Gesture config register dump */
uint8_t reg;
uint8_t val;
@@ -518,12 +518,13 @@ int SparkFun_APDS9960::readGesture()

/* If there's stuff in the FIFO, read it into our data block */
if( fifo_level > 0) {
- bytes_read = wireReadDataBlock( APDS9960_GFIFO_U,
+ int res = wireReadDataBlock( APDS9960_GFIFO_U,
(uint8_t*)fifo_data,
(fifo_level * 4) );
- if( bytes_read == -1 ) {
+ if( res == -1 ) {
return ERROR;
}
+ bytes_read = res;
#if DEBUG
Serial.print("FIFO Dump: ");
for ( i = 0; i < bytes_read; i++ ) {
2 changes: 2 additions & 0 deletions Sming/Libraries/.patches/SparkFun_APDS9960/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
COMPONENT_INCDIRS := src
COMPONENT_SRCDIRS := src
1 change: 1 addition & 0 deletions Sming/Libraries/SparkFun_APDS9960
Submodule SparkFun_APDS9960 added at bb9633
82 changes: 0 additions & 82 deletions Sming/Libraries/SparkFun_APDS9960/README.md

This file was deleted.

Loading
Loading