Comments (4)
What exactly is your application and what exactly is not working?
I made that change because I had an application where there was a problem with the default configuration.
from arduino_stm32.
Here's my very simple test sketch:
void setup() {
Serial.begin(115200);
while (!Serial) delay(10);
delay(1000);
Serial.println ("Timer setup start");
Timer2.pause();
int period = Timer2.setPeriod(10000); // in microseconds
Timer2.setOverflow(1000);
Timer2.refresh();
Timer2.resume();
Serial.print ("Timer setup end, period="); Serial.println (period);
}
void loop() {
uint16_t cnt = Timer2.getCount();
Serial.print("timer2 counter: "); Serial.println(cnt);
delay (500);
}
With your library, I see that the counter is always 0. After deleting the return statement, the counter changes as expected (up to 1000 and then from 0 again).
from arduino_stm32.
I am not going to enable that line in boards.cpp
again.
But I just pushed a commit to solve the issue.
In order to use any timer from now on, one should call
TimerX.init();
This way the timer will be initialized and paused at the same time.
So in your sketch you have to replace
Timer2.pause();
with
Timer2.init();
Please try this and let me know if it works.
from arduino_stm32.
I just tested your sketch modified as suggested and it works, so I will close this now.
Reopen if it does not work for you.
from arduino_stm32.
Related Issues (20)
- RTClock for f3 HOT 3
- Install Core in PlatformIO HOT 1
- SDIO HOT 1
- Broken links HOT 1
- All hardware serial and USB Serial CDC hang up in Arduino 1.8.10 HOT 11
- Red text appears in compiling for Arduino ide 1.8.10 HOT 2
- Error compiling i2c_wire_scanner example HOT 3
- changes for flash.h, flash.c - ART accelerator HOT 5
- Bug in the SPI library HOT 4
- STM32F4: rcc clock settings codes may need to be reworked due to different crystals HOT 2
- STM32F4: HardwareTimer.setperiod(uint32_t usecs) is making it running 2 times too fast. HOT 1
- merge f3 core
- Timers 9-14 interrupt handler setup doesn't work HOT 9
- F4 timers not clocked at init HOT 2
- F4 possible bug in pheriperials bid-band macro HOT 4
- updates in adc.h and adc.c HOT 2
- Unable to compile blink project when board Maple(RET6) is selected from Arduino studio HOT 7
- PR 753 rtc adjustments on original roger's core HOT 2
- STM32F401, F405, F407, f4xx? backup registers HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino_stm32.