Skip to content

Add interrupt feature#15

Open
marqdevx wants to merge 8 commits into
arduino-libraries:masterfrom
marqdevx:master
Open

Add interrupt feature#15
marqdevx wants to merge 8 commits into
arduino-libraries:masterfrom
marqdevx:master

Conversation

@marqdevx
Copy link
Copy Markdown
Member

I've added the minimun configuration to enable the interrupt pin

@github-actions
Copy link
Copy Markdown

Memory usage change @ 95cbcc6

Board flash % RAM for global variables %
arduino:avr:leonardo 💚 -76 - -22 -0.27 - -0.08 0 - 0 0.0 - 0.0
arduino:avr:mega 💚 -76 - -22 -0.03 - -0.01 0 - 0 0.0 - 0.0
arduino:avr:nano 💚 -76 - -22 -0.25 - -0.07 0 - 0 0.0 - 0.0
arduino:mbed_nano:nano33ble 💚 -128 - -64 -0.01 - -0.01 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 💚 -112 - -48 -0.0 - -0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 💚 -128 - 0 -0.01 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 💚 -128 - -64 -0.02 - -0.01 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 💚 -120 - -48 -0.02 - -0.01 N/A N/A
arduino:samd:mkrzero 💚 -108 - -48 -0.04 - -0.02 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ColorSensor
flash
% examples/ColorSensor
RAM for global variables
% examples/FullExample
flash
% examples/FullExample
RAM for global variables
% examples/GestureSensor
flash
% examples/GestureSensor
RAM for global variables
% examples/InterruptLight
flash
% examples/InterruptLight
RAM for global variables
% examples/InterruptProximity
flash
% examples/InterruptProximity
RAM for global variables
% examples/ProximitySensor
flash
% examples/ProximitySensor
RAM for global variables
%
arduino:avr:leonardo -22 -0.08 0 0.0 -76 -0.27 0 0.0 -22 -0.08 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -72 -0.25 0 0.0
arduino:avr:mega -22 -0.01 0 0.0 -76 -0.03 0 0.0 -22 -0.01 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -66 -0.03 0 0.0
arduino:avr:nano -22 -0.07 0 0.0 -76 -0.25 0 0.0 -22 -0.07 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -70 -0.23 0 0.0
arduino:mbed_nano:nano33ble -64 -0.01 0 0.0 -128 -0.01 0 0.0 -64 -0.01 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -64 -0.01 0 0.0
arduino:mbed_nano:nanorp2040connect -48 -0.0 0 0.0 -112 -0.0 0 0.0 -48 -0.0 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -104 -0.0 0 0.0
arduino:mbed_portenta:envie_m4 -64 -0.01 0 0.0 -128 -0.01 0 0.0 0 0.0 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -128 -0.01 0 0.0
arduino:mbed_portenta:envie_m7 -64 -0.01 0 0.0 -128 -0.02 0 0.0 -64 -0.01 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -128 -0.02 0 0.0
arduino:sam:arduino_due_x_dbg -48 -0.01 N/A N/A -120 -0.02 N/A N/A -48 -0.01 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A -112 -0.02 N/A N/A
arduino:samd:mkrzero -48 -0.02 0 0.0 -108 -0.04 0 0.0 -48 -0.02 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -108 -0.04 0 0.0
Click for full report CSV
Board,examples/ColorSensor<br>flash,%,examples/ColorSensor<br>RAM for global variables,%,examples/FullExample<br>flash,%,examples/FullExample<br>RAM for global variables,%,examples/GestureSensor<br>flash,%,examples/GestureSensor<br>RAM for global variables,%,examples/InterruptLight<br>flash,%,examples/InterruptLight<br>RAM for global variables,%,examples/InterruptProximity<br>flash,%,examples/InterruptProximity<br>RAM for global variables,%,examples/ProximitySensor<br>flash,%,examples/ProximitySensor<br>RAM for global variables,%
arduino:avr:leonardo,-22,-0.08,0,0.0,-76,-0.27,0,0.0,-22,-0.08,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-72,-0.25,0,0.0
arduino:avr:mega,-22,-0.01,0,0.0,-76,-0.03,0,0.0,-22,-0.01,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-66,-0.03,0,0.0
arduino:avr:nano,-22,-0.07,0,0.0,-76,-0.25,0,0.0,-22,-0.07,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-70,-0.23,0,0.0
arduino:mbed_nano:nano33ble,-64,-0.01,0,0.0,-128,-0.01,0,0.0,-64,-0.01,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-64,-0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,-48,-0.0,0,0.0,-112,-0.0,0,0.0,-48,-0.0,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-104,-0.0,0,0.0
arduino:mbed_portenta:envie_m4,-64,-0.01,0,0.0,-128,-0.01,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-128,-0.01,0,0.0
arduino:mbed_portenta:envie_m7,-64,-0.01,0,0.0,-128,-0.02,0,0.0,-64,-0.01,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-128,-0.02,0,0.0
arduino:sam:arduino_due_x_dbg,-48,-0.01,N/A,N/A,-120,-0.02,N/A,N/A,-48,-0.01,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-112,-0.02,N/A,N/A
arduino:samd:mkrzero,-48,-0.02,0,0.0,-108,-0.04,0,0.0,-48,-0.02,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-108,-0.04,0,0.0

Copy link
Copy Markdown
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can fix the spell check failure by adding the problematic word in all lower case (als) here;
https://github.com/arduino-libraries/Arduino_APDS9960/blob/master/.codespellrc#L4

Comment thread examples/InterruptLight/InterruptLight.ino Outdated
Comment thread examples/InterruptProximity/InterruptProximity.ino Outdated
Comment thread keywords.txt Outdated
Comment thread src/Arduino_APDS9960.cpp Outdated
Comment thread src/Arduino_APDS9960.cpp Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2021

Memory usage change @ bb0a9b4

Board flash % RAM for global variables %
arduino:avr:leonardo 💚 -76 - -22 -0.27 - -0.08 0 - 0 0.0 - 0.0
arduino:avr:mega 💚 -76 - -22 -0.03 - -0.01 0 - 0 0.0 - 0.0
arduino:avr:nano 💚 -76 - -22 -0.25 - -0.07 0 - 0 0.0 - 0.0
arduino:mbed_nano:nano33ble 💚 -128 - 0 -0.01 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 💚 -112 - -48 -0.0 - -0.0 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m4 💚 -128 - -64 -0.01 - -0.01 0 - 0 0.0 - 0.0
arduino:mbed_portenta:envie_m7 💚 -128 - 0 -0.02 - 0.0 0 - 0 0.0 - 0.0
arduino:sam:arduino_due_x_dbg 💚 -120 - -48 -0.02 - -0.01 N/A N/A
arduino:samd:mkrzero 💚 -108 - -48 -0.04 - -0.02 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ColorSensor
flash
% examples/ColorSensor
RAM for global variables
% examples/FullExample
flash
% examples/FullExample
RAM for global variables
% examples/GestureSensor
flash
% examples/GestureSensor
RAM for global variables
% examples/InterruptLight
flash
% examples/InterruptLight
RAM for global variables
% examples/InterruptProximity
flash
% examples/InterruptProximity
RAM for global variables
% examples/ProximitySensor
flash
% examples/ProximitySensor
RAM for global variables
%
arduino:avr:leonardo -22 -0.08 0 0.0 -76 -0.27 0 0.0 -22 -0.08 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -72 -0.25 0 0.0
arduino:avr:mega -22 -0.01 0 0.0 -76 -0.03 0 0.0 -22 -0.01 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -66 -0.03 0 0.0
arduino:avr:nano -22 -0.07 0 0.0 -76 -0.25 0 0.0 -22 -0.07 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -70 -0.23 0 0.0
arduino:mbed_nano:nano33ble 0 0.0 0 0.0 -128 -0.01 0 0.0 0 0.0 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -128 -0.01 0 0.0
arduino:mbed_nano:nanorp2040connect -48 -0.0 0 0.0 -104 -0.0 0 0.0 -48 -0.0 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -112 -0.0 0 0.0
arduino:mbed_portenta:envie_m4 -64 -0.01 0 0.0 -128 -0.01 0 0.0 -64 -0.01 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -64 -0.01 0 0.0
arduino:mbed_portenta:envie_m7 0 0.0 0 0.0 -128 -0.02 0 0.0 -64 -0.01 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -128 -0.02 0 0.0
arduino:sam:arduino_due_x_dbg -48 -0.01 N/A N/A -120 -0.02 N/A N/A -48 -0.01 N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A -112 -0.02 N/A N/A
arduino:samd:mkrzero -48 -0.02 0 0.0 -108 -0.04 0 0.0 -48 -0.02 0 0.0 N/A N/A N/A N/A N/A N/A N/A N/A -108 -0.04 0 0.0
Click for full report CSV
Board,examples/ColorSensor<br>flash,%,examples/ColorSensor<br>RAM for global variables,%,examples/FullExample<br>flash,%,examples/FullExample<br>RAM for global variables,%,examples/GestureSensor<br>flash,%,examples/GestureSensor<br>RAM for global variables,%,examples/InterruptLight<br>flash,%,examples/InterruptLight<br>RAM for global variables,%,examples/InterruptProximity<br>flash,%,examples/InterruptProximity<br>RAM for global variables,%,examples/ProximitySensor<br>flash,%,examples/ProximitySensor<br>RAM for global variables,%
arduino:avr:leonardo,-22,-0.08,0,0.0,-76,-0.27,0,0.0,-22,-0.08,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-72,-0.25,0,0.0
arduino:avr:mega,-22,-0.01,0,0.0,-76,-0.03,0,0.0,-22,-0.01,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-66,-0.03,0,0.0
arduino:avr:nano,-22,-0.07,0,0.0,-76,-0.25,0,0.0,-22,-0.07,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-70,-0.23,0,0.0
arduino:mbed_nano:nano33ble,0,0.0,0,0.0,-128,-0.01,0,0.0,0,0.0,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-128,-0.01,0,0.0
arduino:mbed_nano:nanorp2040connect,-48,-0.0,0,0.0,-104,-0.0,0,0.0,-48,-0.0,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-112,-0.0,0,0.0
arduino:mbed_portenta:envie_m4,-64,-0.01,0,0.0,-128,-0.01,0,0.0,-64,-0.01,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-64,-0.01,0,0.0
arduino:mbed_portenta:envie_m7,0,0.0,0,0.0,-128,-0.02,0,0.0,-64,-0.01,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-128,-0.02,0,0.0
arduino:sam:arduino_due_x_dbg,-48,-0.01,N/A,N/A,-120,-0.02,N/A,N/A,-48,-0.01,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-112,-0.02,N/A,N/A
arduino:samd:mkrzero,-48,-0.02,0,0.0,-108,-0.04,0,0.0,-48,-0.02,0,0.0,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,-108,-0.04,0,0.0

Comment thread keywords.txt
Comment thread src/Arduino_APDS9960.cpp
if (!setGPULSE(0x8F)) return false; // 16us, 16 pulses // default is: 0x40 = 8us, 1 pulse
if (!setPPULSE(0x8F)) return false; // 16us, 16 pulses // default is: 0x40 = 8us, 1 pulse
if (!setGestureIntEnable(true)) return false;
//if (!setGestureIntEnable(true)) return false;
Copy link
Copy Markdown

@Rocketct Rocketct Jul 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not fine, if useless remove the cmment otherwise add and fix incompatibility

Comment thread src/Arduino_APDS9960.cpp
Comment on lines +69 to +70
/*clearLightInterrupt();
clearProximityInterrupt();*/
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Comment thread src/Arduino_APDS9960.cpp
}

disableProximity();
//disableProximity();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Comment thread src/Arduino_APDS9960.cpp
#else
APDS9960 APDS(Wire, -1);
#endif
#endif No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line here

Comment thread src/Arduino_APDS9960.cpp
Comment on lines +485 to +487
data &= 0b01111111; //MSB reserved
data |= 0b1; //PowerON
data |= 0b00010000; //ALS
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no number create macros and give a meanings to each action

Comment thread src/Arduino_APDS9960.cpp
void APDS9960::enableProximityInterrupt(){
uint8_t data;
getENABLE(&data);
data &= 0b01111111; //MSB reserved
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no number create macros and give a meanings to each action

Comment thread src/Arduino_APDS9960.cpp
Comment on lines +456 to +458
data &= 0b01111111; //MSB reserved
data |= 0b1; //PowerON
data &= 0b01011111; //Int prox disable
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no number create macros and give a meanings to each action

Comment thread src/Arduino_APDS9960.h
extern APDS9960 APDS;

#endif // ARDUINO_APDS9960
#endif // ARDUINO_APDS9960 No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add new line here

@aentinger
Copy link
Copy Markdown
Contributor

@marqdevx please address the feedback provided by @Rocketct so we can move on and merge this one.

@per1234 per1234 added status: changes requested Changes to PR are required before merge topic: code Related to content of the project itself type: enhancement Proposed improvement labels Jan 15, 2022
@per1234 per1234 dismissed their stale review January 15, 2022 06:46

All the changes I requested have been made. Thanks!

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: changes requested Changes to PR are required before merge topic: code Related to content of the project itself type: enhancement Proposed improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants