This repository has been archived by the owner on Jan 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.1.0 to convert to h-only library, etc
### Releases v1.1.0 1. Convert to h-only library. 2. Optimize library code by using `reference-passing` instead of `value-passing` 3. Improve accuracy by using `float`, instead of `uint32_t` for `position` in degrees 4. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
- Loading branch information
1 parent
8f8f550
commit 9dd199d
Showing
10 changed files
with
81 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,6 @@ | |
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
Based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
Based on BlynkTimer.h | ||
Author: Volodymyr Shymanskyy | ||
Version: 1.0.0 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 15/08/2021 Initial coding for STM32F/L/H/G/WB/MP1 | ||
*****************************************************************************************************************************/ | ||
|
||
/**************************************************************************************************************************** | ||
|
@@ -61,6 +48,7 @@ | |
#define TIMER_INTERRUPT_DEBUG 0 | ||
#define ISR_SERVO_DEBUG 1 | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
// Default is TIMER_SERVO (TIM7 for many boards) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,6 @@ | |
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
Based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
Based on BlynkTimer.h | ||
Author: Volodymyr Shymanskyy | ||
Version: 1.0.0 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 15/08/2021 Initial coding for STM32F/L/H/G/WB/MP1 | ||
*****************************************************************************************************************************/ | ||
|
||
/**************************************************************************************************************************** | ||
|
@@ -61,6 +48,7 @@ | |
#define TIMER_INTERRUPT_DEBUG 0 | ||
#define ISR_SERVO_DEBUG 1 | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
// Default is TIMER_SERVO (TIM7 for many boards) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,6 @@ | |
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
Based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
Based on BlynkTimer.h | ||
Author: Volodymyr Shymanskyy | ||
Version: 1.0.0 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 15/08/2021 Initial coding for STM32F/L/H/G/WB/MP1 | ||
*****************************************************************************************************************************/ | ||
|
||
/**************************************************************************************************************************** | ||
|
@@ -61,6 +48,7 @@ | |
#define TIMER_INTERRUPT_DEBUG 0 | ||
#define ISR_SERVO_DEBUG 1 | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
// Default is TIMER_SERVO (TIM7 for many boards) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,6 @@ | |
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
Based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
Based on BlynkTimer.h | ||
Author: Volodymyr Shymanskyy | ||
Version: 1.0.0 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 15/08/2021 Initial coding for STM32F/L/H/G/WB/MP1 | ||
*****************************************************************************************************************************/ | ||
|
||
/**************************************************************************************************************************** | ||
|
@@ -61,6 +48,7 @@ | |
#define TIMER_INTERRUPT_DEBUG 0 | ||
#define ISR_SERVO_DEBUG 1 | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
// Default is TIMER_SERVO (TIM7 for many boards) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,6 @@ | |
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
Based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
Based on BlynkTimer.h | ||
Author: Volodymyr Shymanskyy | ||
Version: 1.0.0 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 15/08/2021 Initial coding for STM32F/L/H/G/WB/MP1 | ||
*****************************************************************************************************************************/ | ||
/**************************************************************************************************************************** | ||
From ESP32 Servo Example Using Arduino ESP32 Servo Library | ||
|
@@ -60,6 +47,7 @@ | |
#define TIMER_INTERRUPT_DEBUG 0 | ||
#define ISR_SERVO_DEBUG 1 | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
// Default is TIMER_SERVO (TIM7 for many boards) | ||
|
@@ -69,8 +57,8 @@ | |
#define MIN_MICROS 800 //544 | ||
#define MAX_MICROS 2450 | ||
|
||
#define SERVO_PIN_1 D1 | ||
#define SERVO_PIN_2 D2 | ||
#define SERVO_PIN_1 PA_0 //D1 | ||
#define SERVO_PIN_2 PA_1 //D2 | ||
#define SERVO_PIN_3 D3 | ||
#define SERVO_PIN_4 D4 | ||
#define SERVO_PIN_5 D5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,19 +5,6 @@ | |
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
Based on SimpleTimer - A timer library for Arduino. | ||
Author: [email protected] | ||
Copyright (c) 2010 OTTOTECNICA Italy | ||
Based on BlynkTimer.h | ||
Author: Volodymyr Shymanskyy | ||
Version: 1.0.0 | ||
Version Modified By Date Comments | ||
------- ----------- ---------- ----------- | ||
1.0.0 K Hoang 15/08/2021 Initial coding for STM32F/L/H/G/WB/MP1 | ||
*****************************************************************************************************************************/ | ||
|
||
/**************************************************************************************************************************** | ||
|
@@ -61,6 +48,7 @@ | |
#define TIMER_INTERRUPT_DEBUG 0 | ||
#define ISR_SERVO_DEBUG 1 | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
// Default is TIMER_SERVO (TIM7 for many boards) | ||
|
Binary file added
BIN
+32.5 KB
examples/STM32_MultipleServos/STM32_MultipleServos.ino.NUCLEO_H743ZI2.bin
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/**************************************************************************************************************************** | ||
multiFileProject.cpp | ||
For STM32F/L/H/G/WB/MP1 boards with stm32duino Arduino_Core_STM32 core | ||
Written by Khoi Hoang | ||
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
*****************************************************************************************************************************/ | ||
|
||
// To demo how to include files in multi-file Projects | ||
|
||
#include "multiFileProject.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/**************************************************************************************************************************** | ||
multiFileProject.h | ||
For STM32F/L/H/G/WB/MP1 boards with stm32duino Arduino_Core_STM32 core | ||
Written by Khoi Hoang | ||
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
*****************************************************************************************************************************/ | ||
|
||
// To demo how to include files in multi-file Projects | ||
|
||
#pragma once | ||
|
||
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/**************************************************************************************************************************** | ||
multiFileProject.ino | ||
For STM32F/L/H/G/WB/MP1 boards with stm32duino Arduino_Core_STM32 core | ||
Written by Khoi Hoang | ||
Built by Khoi Hoang https://github.com/khoih-prog/STM32_ISR_Servo | ||
Licensed under MIT license | ||
*****************************************************************************************************************************/ | ||
|
||
// To demo how to include files in multi-file Projects | ||
|
||
#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \ | ||
defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \ | ||
defined(STM32WB) || defined(STM32MP1) || defined(STM32L5)) | ||
#error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting. | ||
#endif | ||
|
||
#define STM32_ISR_SERVO_VERSION_MIN_TARGET "STM32_ISR_Servo v1.1.0" | ||
#define STM32_ISR_SERVO_VERSION_MIN 1001000 | ||
|
||
#include "multiFileProject.h" | ||
|
||
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error | ||
#include "STM32_ISR_Servo.h" | ||
|
||
void setup() | ||
{ | ||
Serial.begin(115200); | ||
while (!Serial); | ||
|
||
Serial.println("\nStart multiFileProject"); | ||
Serial.println(STM32_ISR_SERVO_VERSION); | ||
|
||
#if defined(STM32_ISR_SERVO_VERSION_MIN) | ||
if (STM32_ISR_SERVO_VERSION_INT < STM32_ISR_SERVO_VERSION_MIN) | ||
{ | ||
Serial.print("Warning. Must use this example on Version equal or later than : "); | ||
Serial.println(STM32_ISR_SERVO_VERSION_MIN_TARGET); | ||
} | ||
#endif | ||
} | ||
|
||
void loop() | ||
{ | ||
// put your main code here, to run repeatedly: | ||
} |