Skip to content

Commit

Permalink
v1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Trusty77 committed Dec 24, 2018
1 parent 1ed95e4 commit fdd5d54
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 43 deletions.
Binary file modified DIO2.zip
Binary file not shown.
Binary file added History/DIO2.1.5.0.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ http://git.framasoft.org/locoduino.org/DIO2/wikis/home for both french and engli

Copyright (c) Jan Dolinay, All right reserved.
Copyright (c) 2016 Locoduino.org. All right reserved.
Copyright (c) 2016 Thierry Paris. All right reserved.
Copyright (c) 2016-2019 Thierry Paris. All right reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=DIO2
version=1.4.1
version=1.5.0
author=Thierry Paris - Locoduino
maintainer=Thierry Paris - Locoduino
sentence=Fast digital input/output functions.
paragraph=From a work of Jan Dolinay
category=Device Control
url=https://github.com/Locoduino.org/DIO2
architectures=avr,sam,esp32
architectures=avr,sam,esp32,STM32F1
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Works also for Nano R3, Leonardo and Due (only for compatibility).

Revision History
----------------
December 2018 - Version 1.5.0
Add support for non AVR architectures.

July 2018 - Version 1.4.1
Fix Keywords.txt format.

Expand Down
77 changes: 39 additions & 38 deletions src/DIO2.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,7 @@
#ifndef ARDUINO2_H_
#define ARDUINO2_H_

#if defined(ARDUINO_ARCH_SAM) || defined(ARDUINO_ARCH_ESP32)

// DUE version
// The due is probably fast enough to access ports very efficiency (and i dont know how to make better !) .
// So the functions are dummies, and conduct to original Arduino functions...

typedef int GPIO_pin_t;
#define pinMode2(P, M) pinMode(P, M)
#define digitalWrite2(P, V) digitalWrite(P, V)
#define digitalRead2(P) digitalRead(P)

#define pinMode2f(P, M) pinMode(P, M)
#define digitalWrite2f(P, V) digitalWrite(P, V)
#define digitalRead2f(P) digitalRead(P)

#define Arduino_to_GPIO_pin(P) (P)
#define GPIO_to_Arduino_pin(P) (P)

#define DP_INVALID 0xFFFF
#define DP0 0
#define DP1 1
#define DP2 2
#define DP3 3
#define DP4 4
#define DP5 5
#define DP6 6
#define DP7 7

#include "Arduino.h"

#ifdef F
#undef F
#endif

#define F(str) str
#define __FlashStringHelper char

#else
#if defined(ARDUINO_ARCH_AVR)

// Standard headers for AVR
#include <avr/pgmspace.h>
Expand Down Expand Up @@ -427,5 +390,43 @@ int GPIO_to_Arduino_pin(GPIO_pin_t inPin);
#ifdef __cplusplus
} // extern "C"
#endif

#else

// ARM / ESP / STM versions
// These procs are probably fast enough to access ports very efficiency (and i dont know how to make better !) .
// So the functions are dummies, and conduct to original wiring functions...

typedef int GPIO_pin_t;
#define pinMode2(P, M) pinMode(P, M)
#define digitalWrite2(P, V) digitalWrite(P, V)
#define digitalRead2(P) digitalRead(P)

#define pinMode2f(P, M) pinMode(P, M)
#define digitalWrite2f(P, V) digitalWrite(P, V)
#define digitalRead2f(P) digitalRead(P)

#define Arduino_to_GPIO_pin(P) (P)
#define GPIO_to_Arduino_pin(P) (P)

#define DP_INVALID 0xFFFF
#define DP0 0
#define DP1 1
#define DP2 2
#define DP3 3
#define DP4 4
#define DP5 5
#define DP6 6
#define DP7 7

#include "Arduino.h"

#ifdef F
#undef F
#endif

#define F(str) str
#define __FlashStringHelper char

#endif
#endif /* DIO2_H_ */
4 changes: 2 additions & 2 deletions src/digital2.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*
*/

#include "Arduino.h"
#if defined(ARDUINO_ARCH_AVR)

#if !defined(_LIB_SAM_) && !defined(ARDUINO_ARCH_ESP32)
#include "Arduino.h"

// Standard headers for AVR
#include <avr/pgmspace.h>
Expand Down

0 comments on commit fdd5d54

Please sign in to comment.