From 231526d8425a055c3ca98962f3567cf65f19615a Mon Sep 17 00:00:00 2001 From: Thierry Date: Fri, 31 May 2019 21:16:43 +0200 Subject: [PATCH] v1.5.1 --- README.adoc | 4 +- VStudio/DIO2.cpp | 32 ++++++----- VStudio/DIO2.h | 19 ++++--- VStudio/DIO2.hpp | 18 ------ VStudio/DIO2.vcxproj | 129 ++++++++++++++++++++++++++++++------------- library.properties | 2 +- readme.txt | 27 +++++---- 7 files changed, 136 insertions(+), 95 deletions(-) diff --git a/README.adoc b/README.adoc index e6d25a3..602b31a 100644 --- a/README.adoc +++ b/README.adoc @@ -4,7 +4,7 @@ This library providest fast digital read and write. Originaly written by Jan Dolinay, updated by Thierry Paris. -Original sources from Jan available here: https://github.com/jdolinay/Arduino_DIO2 +Original sources from Jan available here: https://github.com/jdolinay/Arduino_DIO2 . Article here https://www.codeproject.com/Articles/732646/Fast-digital-I-O-for-Arduino For more information about this library please visit us at http://www.locoduino.org/spip.php?article165 in french or @@ -13,7 +13,7 @@ http://git.framasoft.org/locoduino.org/DIO2/wikis/home for both french and engli == License == Copyright (c) Jan Dolinay, All right reserved. -Copyright (c) 2016 Locoduino.org. All right reserved. +Copyright (c) 2016-2019 Locoduino.org. All right reserved. Copyright (c) 2016-2019 Thierry Paris. All right reserved. This library is free software; you can redistribute it and/or diff --git a/VStudio/DIO2.cpp b/VStudio/DIO2.cpp index b9896ba..8a0ae1b 100644 --- a/VStudio/DIO2.cpp +++ b/VStudio/DIO2.cpp @@ -1,39 +1,41 @@ #define ARDUINO2_MAIN +#include "stdafx.h" #include "DIO2.hpp" #include "DIO2.h" +#include "ArduiEmulator.hpp" -void DIO2::DioClass::_pinMode2(uint8_t pin, uint8_t mode) +void pinMode2(uint8_t pin, uint8_t mode) { - ArduiEmulator::Arduino::_pinMode(pin, mode); + pinMode(pin, mode); } -void DIO2::DioClass::_digitalWrite2(uint8_t pin, uint8_t val) +void digitalWrite2(uint8_t pin, uint8_t val) { - ArduiEmulator::Arduino::_digitalWrite(pin, val); + digitalWrite(pin, val); } -uint8_t DIO2::DioClass::_digitalRead2(uint8_t pin) +uint8_t digitalRead2(uint8_t pin) { - return ArduiEmulator::Arduino::_digitalRead(pin); + return digitalRead(pin); } -void DIO2::DioClass::_pinMode2f(GPIO_pin_t pin, uint8_t mode) +void pinMode2f(GPIO_pin_t pin, uint8_t mode) { - ArduiEmulator::Arduino::_pinMode(_GPIO_to_Arduino_pin(pin), mode); + pinMode(GPIO_to_Arduino_pin(pin), mode); } -uint8_t DIO2::DioClass::_digitalRead2f(GPIO_pin_t pin) +uint8_t digitalRead2f(GPIO_pin_t pin) { - return ArduiEmulator::Arduino::_digitalRead(_GPIO_to_Arduino_pin(pin)); + return digitalRead(GPIO_to_Arduino_pin(pin)); } -void DIO2::DioClass::_digitalWrite2f(GPIO_pin_t pin, uint8_t value) +void digitalWrite2f(GPIO_pin_t pin, uint8_t value) { - ArduiEmulator::Arduino::_digitalWrite(_GPIO_to_Arduino_pin(pin), value); -} + digitalWrite(GPIO_to_Arduino_pin(pin), value); +} -int DIO2::DioClass::_GPIO_to_Arduino_pin(GPIO_pin_t inPin) +int GPIO_to_Arduino_pin(GPIO_pin_t inPin) { int i; for (i = 0; i < GPIO_PINS_NUMBER; i++) @@ -45,7 +47,7 @@ int DIO2::DioClass::_GPIO_to_Arduino_pin(GPIO_pin_t inPin) return -1; } -GPIO_pin_t DIO2::DioClass::_Arduino_to_GPIO_pin(int inPin) +GPIO_pin_t Arduino_to_GPIO_pin(int inPin) { return gpio_pins_progmem[inPin]; } diff --git a/VStudio/DIO2.h b/VStudio/DIO2.h index 84b5ac2..e54c192 100644 --- a/VStudio/DIO2.h +++ b/VStudio/DIO2.h @@ -3,20 +3,23 @@ #define DIO2_H_ //------------------------------------------------------------------- +#include "stdafx.h" + #include "Arduino.h" +//#include "ArduiEmulator.hpp" #include "../board/mega/pins2_arduino.h" -#define pinMode2(pin, mode) ArduiEmulator::Arduino::_pinMode(DIO2::DioClass::_GPIO_to_Arduino_pin(pin), mode) -#define digitalWrite2(pin, val) ArduiEmulator::Arduino::_digitalWrite(DIO2::DioClass::_GPIO_to_Arduino_pin(pin), val); -#define digitalRead2(pin) ArduiEmulator::Arduino::_digitalRead(DIO2::DioClass::_GPIO_to_Arduino_pin(pin)); +extern void pinMode2(uint8_t pin, uint8_t mode); +extern void digitalWrite2(uint8_t pin, uint8_t val); +extern uint8_t digitalRead2(uint8_t pin); -#define pinMode2f(pin, mode) ArduiEmulator::Arduino::_pinMode(DIO2::DioClass::_GPIO_to_Arduino_pin(pin), mode); -#define digitalWrite2f(pin, value) ArduiEmulator::Arduino::_digitalWrite(DIO2::DioClass::_GPIO_to_Arduino_pin(pin), value) -#define digitalRead2f(pin) ArduiEmulator::Arduino::_digitalRead(DIO2::DioClass::_GPIO_to_Arduino_pin(pin)); +extern void pinMode2f(GPIO_pin_t pin, uint8_t mode); +extern uint8_t digitalRead2f(GPIO_pin_t pin); +extern void digitalWrite2f(GPIO_pin_t pin, uint8_t value); -#define GPIO_to_Arduino_pin(GPIO_PIN) DIO2::DioClass::_GPIO_to_Arduino_pin(GPIO_PIN) -#define Arduino_to_GPIO_pin(PIN) DIO2::DioClass::_Arduino_to_GPIO_pin(PIN) +extern GPIO_pin_t Arduino_to_GPIO_pin(int aa); +extern int GPIO_to_Arduino_pin(GPIO_pin_t aa); //------------------------------------------------------------------- #endif diff --git a/VStudio/DIO2.hpp b/VStudio/DIO2.hpp index 10d86e5..376f4a0 100644 --- a/VStudio/DIO2.hpp +++ b/VStudio/DIO2.hpp @@ -5,24 +5,6 @@ #include "DIO2.h" -namespace DIO2 -{ - public ref class DioClass - { - public: - static void _pinMode2(uint8_t pin, uint8_t mode); - static void _digitalWrite2(uint8_t pin, uint8_t val); - static uint8_t _digitalRead2(uint8_t pin); - - static void _pinMode2f(GPIO_pin_t pin, uint8_t mode); - static uint8_t _digitalRead2f(GPIO_pin_t pin); - static void _digitalWrite2f(GPIO_pin_t pin, uint8_t value); - - static GPIO_pin_t _Arduino_to_GPIO_pin(int aa); - static int _GPIO_to_Arduino_pin(GPIO_pin_t aa); - }; -}; - //------------------------------------------------------------------- #endif //------------------------------------------------------------------- diff --git a/VStudio/DIO2.vcxproj b/VStudio/DIO2.vcxproj index 3c741e7..38ed8ce 100644 --- a/VStudio/DIO2.vcxproj +++ b/VStudio/DIO2.vcxproj @@ -1,6 +1,14 @@  + + Debug + Win32 + + + Release + Win32 + Debug x64 @@ -11,33 +19,50 @@ + 15.0 {CC4048D1-7AC0-4D3D-98A3-2922D996B5AB} - v4.6.1 - ManagedCProj + Win32Proj DIO2 - 8.1 + 10.0 + + + + StaticLibrary + true + v142 + Unicode + + + StaticLibrary + false + v142 + true + Unicode - DynamicLibrary + StaticLibrary true - v141 + v142 Unicode - true - DynamicLibrary + StaticLibrary false - v141 + v142 true Unicode - true - + + + + + + @@ -45,39 +70,85 @@ + + true + + + true + $(SolutionDir)$(Platform)\$(Configuration)\ + + + false + + + false + + + + Use + Level3 + Disabled + true + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + + + Windows + true + + - - + NotUsing Level3 Disabled + true _DEBUG;_LIB;VISUALSTUDIO;ARDUINO_AVR_MEGA2560;_DIO2_EXPORTING;%(PreprocessorDefinitions) - $(VisualStudioDir)\..\Arduino\ArduiEmulator\ArduiEmulator + true + $(VisualStudioDir)\..\Arduino\ArduiEmulatorWin\ArduiEmulatorLib + MultiThreadedDebug Windows - DebugFull + true true - + + + + Use + Level3 + MaxSpeed + true + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + + Windows - + true + true + true + + Use Level3 - - MaxSpeed true true + true NDEBUG;_LIB;%(PreprocessorDefinitions);VISUALSTUDIO - $(VisualStudioDir)\..\Arduino\ArduiEmulator\ArduiEmulator + true + $(VisualStudioDir)\..\Arduino\ArduiEmulatorWin\ArduiEmulatorLib Windows true true + true @@ -87,26 +158,6 @@ - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Data.dll - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Drawing.dll - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Windows.Forms.dll - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.XML.dll - - - - - {2cedff9d-11ac-46b3-92b0-8b43cbccffac} - - diff --git a/library.properties b/library.properties index ffdd46f..b3cc852 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=DIO2 -version=1.5.0 +version=1.5.1 author=Thierry Paris - Locoduino maintainer=Thierry Paris - Locoduino sentence=Fast digital input/output functions. diff --git a/readme.txt b/readme.txt index 5fc1674..0584db3 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ Fast digital I/O functions for Arduino. -Created by Jan Dolinay, Feb. 2014 +Created by Jan Dolinay, Feb. 2014 [https://www.codeproject.com/Articles/732646/Fast-digital-I-O-for-Arduino] Works for Arduino Uno and Arduino Mega Version 1.1 from Thierry Paris, @@ -7,39 +7,42 @@ Works also for Nano R3, Leonardo and Due (only for compatibility). Revision History ---------------- +Mai 2019 - Version 1.5.1 +- Change Visual Studio project to be conform to ArduiEmulator 2.0.0 + December 2018 - Version 1.5.0 -Add support for non AVR architectures. +- Add support (just a bypass...) for non AVR architectures. July 2018 - Version 1.4.1 -Fix Keywords.txt format. +- Fix Keywords.txt format. July 2017 - Version 1.4 -Add new samples for Arduino Leonardo and Arduino Micro -Add analog pins declaration for Uno and Nano . +- Add new samples for Arduino Leonardo and Arduino Micro +- Add analog pins declaration for Uno and Nano . December 2016 - Version 1.3 -Add good definitions for analog pins for Mega. +- Add good definitions for analog pins for Mega. September 2016 - Version 1.2 -DUE compatibility added. In fact, just redirect the DIO functions to classic Arduino functions... +- DUE compatibility added. In fact, just redirect the DIO functions to classic Arduino functions... April 2016 - Version 1.1 -Arduino Nano and Leonardo added. Due has been added also, but only for compatibility, +- Arduino Nano and Leonardo added. Due has been added also, but only for compatibility, no improvementf or that kind of Arduino. -No more file copy necessary at library installation. The compilation will choose the +- No more file copy necessary at library installation. The compilation will choose the right include file according to the Arduino IDE flags. -A new function GPIO_to_Arduino_pin has been added to transform a GPIO_pin_t into a +- A new function GPIO_to_Arduino_pin has been added to transform a GPIO_pin_t into a classic pin number in integer type. March 2015 - Version 1.0 -Directory structure changed so that this package can be installed as Arduino library. +- Directory structure changed so that this package can be installed as an Arduino library. February 2014 - First release. Contents of this package: ------------------------- -board - files with pin definitios for supported boards (Uno and Mega). This need to be copied to +board - files with pin definitions for supported boards (Uno and Mega). This need to be copied to appropriate location in your Arduino installation! (see instructions below). examples - example sketches for Arduino Uno and Mega to test the new digital I/O. src - source code of the library