File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
hardware/AMEL/samd/variants/AMEL_SmartEverything Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -272,6 +272,25 @@ void SERCOM5_Handler()
272272 BLE.IrqHandler ();
273273}
274274
275+ void ledYellowTwoLight (uint32_t value) {
276+ if (value == HIGH) {
277+ digitalWrite (PIN_LED_RXL, LOW);
278+ } else if (value == LOW) {
279+ digitalWrite (PIN_LED_RXL, HIGH);
280+ } else {
281+ analogWrite (PIN_LED_RXL, 255 -value); // in case of PWM
282+ }
283+ }
284+
285+ void ledYellowOneLight (uint32_t value) {
286+ if (value == HIGH) {
287+ digitalWrite (PIN_LED_TXL, LOW);
288+ } else if (value == LOW) {
289+ digitalWrite (PIN_LED_TXL, HIGH);
290+ } else {
291+ analogWrite (PIN_LED_TXL, 255 -value); // in case of PWM
292+ }
293+ }
275294
276295void ledGreenLight (uint32_t value) {
277296 if (value == HIGH) {
Original file line number Diff line number Diff line change @@ -191,6 +191,18 @@ void ledGreenLight(uint32_t value);
191191void ledRedLight (uint32_t value );
192192void ledBlueLight (uint32_t value );
193193
194+ /*
195+ Yellow Led wrapper function
196+ These functions has been created for a more comfortable use
197+ because internally wrap the inversion of the HIGH, LOW meaning
198+
199+ Using these function it remain the same Arduino User Experience to light a led
200+ HIGH = Light ON
201+ LOW = Light OFF
202+
203+ */
204+ void ledYellowOneLight (uint32_t value );
205+ void ledYellowTwoLight (uint32_t value );
194206
195207/*
196208 User Button wrapper function.
@@ -258,6 +270,9 @@ extern Uart SigFox;
258270#define LED_RED_INIT pinMode(PIN_LED_RED, OUTPUT)
259271#define LED_BLUE_INIT pinMode(PIN_LED_BLUE, OUTPUT)
260272
273+ #define LED_YELLOW_TWO_INIT pinMode(PIN_LED_RXL, OUTPUT)
274+ #define LED_YELLOW_ONE_INIT pinMode(PIN_LED_TXL, OUTPUT)
275+
261276
262277extern uint8_t smeInitError ;
263278#endif /* _VARIANT_AMEL_SMARTEVERYTHING_ */
Original file line number Diff line number Diff line change @@ -150,6 +150,11 @@ static void ioExtenderInit(void) {
150150
151151
152152void initVariant () {
153+
154+ // initializa the two Yellow Led
155+ LED_YELLOW_ONE_INIT;
156+ LED_YELLOW_TWO_INIT;
157+
153158 // reset the I/O Extender
154159 pinMode (PIN_IO_EXT_RST, OUTPUT);
155160 digitalWrite (PIN_IO_EXT_RST, LOW);
You can’t perform that action at this time.
0 commit comments