Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit 3c5064b

Browse files
authored
Update README.md and use allman astyle
1 parent bccf864 commit 3c5064b

File tree

5 files changed

+40
-30
lines changed

5 files changed

+40
-30
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.19
3030
Arduino megaAVR Core Version 1.8.7
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.15.0-53-generic #59~20.04.1-Ubuntu SMP Thu Oct 20 15:10:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered a crash while trying to use the Timer Interrupt.

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
77
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/megaAVR_PWM.svg)](http://github.com/khoih-prog/megaAVR_PWM/issues)
88

9+
910
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
1011
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
13+
<a href="https://profile-counter.glitch.me/khoih-prog-megaAVR_PWM/count.svg" title="megaAVR_PWM Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-megaAVR_PWM/count.svg" style="height: 30px;width: 200px;"></a>
1114

1215
---
1316
---
@@ -179,7 +182,7 @@ TCB0-TCB3 are 16-bit timers.
179182
Before using any Timer, you have to make sure the **Timer has not been used by any other purpose.**
180183

181184

182-
```
185+
```cpp
183186
/******************************************************************************************************************************
184187
Pins can be used for hardware-PWM
185188
// For ATmega4809 (Nano Every, Uno WiFi Rev2, etc.)
@@ -326,7 +329,7 @@ https://github.com/khoih-prog/megaAVR_PWM/blob/7c73a23cf395fb3e7f8bdea6015bd412f
326329
The following is the sample terminal output when running example [PWM_DynamicDutyCycle](examples/PWM_DynamicDutyCycle) on **megaAVR Nano Every** using `MegaCoreX`, to demonstrate the ability to provide high PWM frequencies and ability to change DutyCycle `on-the-fly`.
327330

328331

329-
```
332+
```cpp
330333
Starting PWM_DynamicDutyCycle on MegaCoreX Nano Every
331334
megaAVR_PWM v1.0.0
332335
[PWM] megaAVR_PWM: _dutycycle = 32767
@@ -378,7 +381,7 @@ Actual data: pin = 3, PWM DC = 90.00, PWMPeriod = 250.00, PWM Freq (Hz) = 1000.0
378381
379382
The following is the sample terminal output when running example [**PWM_Multi**](examples/PWM_Multi) on **megaAVR Nano Every**, to demonstrate the ability to provide high PWM frequencies on multiple `PWM-capable` pins.
380383
381-
```
384+
```cpp
382385
Starting PWM_Multi on megaAVR Nano Every
383386
megaAVR_PWM v1.0.0
384387
=====================================================================================
@@ -400,7 +403,7 @@ Actual data: pin = 6, PWM DC = 50.00, PWMPeriod = 62.00, PWM Freq (Hz) = 4000.00
400403

401404
The following is the sample terminal output when running example [**PWM_DynamicFreq**](examples/PWM_DynamicFreq) on **megaAVR Nano Every**, to demonstrate the ability to change dynamically PWM frequencies.
402405

403-
```
406+
```cpp
404407
Starting PWM_DynamicFreq on megaAVR Nano Every
405408
megaAVR_PWM v1.0.0
406409
[PWM] megaAVR_PWM: _dutycycle = 32767
@@ -443,7 +446,7 @@ Actual data: pin = 3, PWM DC = 50.00, PWMPeriod = 250.00, PWM Freq (Hz) = 1000.0
443446
The following is the sample terminal output when running example [**PWM_Waveform**](examples/PWM_Waveform) on **megaAVR Nano Every**, to demonstrate how to use the `setPWM_manual()` function in wafeform creation
444447
445448
446-
```
449+
```cpp
447450
Starting PWM_Waveform on megaAVR Nano Every
448451
megaAVR_PWM v1.0.0
449452
[PWM] megaAVR_PWM: _dutycycle = 0
@@ -568,4 +571,4 @@ If you want to contribute to this project:
568571

569572
## Copyright
570573

571-
Copyright 2022- Khoi Hoang
574+
Copyright (c) 2022- Khoi Hoang

changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
77
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/megaAVR_PWM.svg)](http://github.com/khoih-prog/megaAVR_PWM/issues)
88

9+
10+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
11+
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total khoih-prog Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
13+
<a href="https://profile-counter.glitch.me/khoih-prog-megaAVR_PWM/count.svg" title="megaAVR_PWM Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-megaAVR_PWM/count.svg" style="height: 30px;width: 200px;"></a>
14+
15+
916
---
1017
---
1118

examples/PWM_Multi/PWM_Multi.ino

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@
3333
#define USING_TIMERB true
3434

3535
#if USING_TIMERB
36-
// Pins tested OK in Nano Every ATmega4809
37-
#define pinToUse 3 // TimerB1, for higher frequencies, up to 100KHz
38-
//#define pinToUse 6 // TimerB0, for higher frequencies, up to 100KHz
39-
40-
uint32_t PWM_Pins[] = { 3, 6 };
36+
// Pins tested OK in Nano Every ATmega4809
37+
#define pinToUse 3 // TimerB1, for higher frequencies, up to 100KHz
38+
//#define pinToUse 6 // TimerB0, for higher frequencies, up to 100KHz
39+
40+
uint32_t PWM_Pins[] = { 3, 6 };
4141

4242
#elif USING_ARDUINO_MEGA_AVR_CORE
43-
// Pins tested OK in Nano Every ATmega4809
44-
#define pinToUse 5 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
45-
//#define pinToUse 9 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
46-
//#define pinToUse 10 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
47-
48-
// Only 1 pin to be used for TimerA0. All sharing same frequency
49-
uint32_t PWM_Pins[] = { 5 };
43+
// Pins tested OK in Nano Every ATmega4809
44+
#define pinToUse 5 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
45+
//#define pinToUse 9 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
46+
//#define pinToUse 10 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
47+
48+
// Only 1 pin to be used for TimerA0. All sharing same frequency
49+
uint32_t PWM_Pins[] = { 5 };
5050

5151
#else
52-
#error TimerA0 to be used with Arduino megaAVR Core
52+
#error TimerA0 to be used with Arduino megaAVR Core
5353
#endif
5454

5555
////////////////////////////////////////////

examples/PWM_MultiChannel/PWM_MultiChannel.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@
3333
#define USING_TIMERB true
3434

3535
#if USING_TIMERB
36-
// Pins tested OK in Nano Every ATmega4809
37-
#define pinToUse 3 // TimerB1, for higher frequencies, up to 100KHz
38-
//#define pinToUse 6 // TimerB0, for higher frequencies, up to 100KHz
36+
// Pins tested OK in Nano Every ATmega4809
37+
#define pinToUse 3 // TimerB1, for higher frequencies, up to 100KHz
38+
//#define pinToUse 6 // TimerB0, for higher frequencies, up to 100KHz
3939

4040
uint32_t PWM_Pins[] = { 3, 6 };
4141

4242
#elif USING_ARDUINO_MEGA_AVR_CORE
43-
// Pins tested OK in Nano Every ATmega4809
44-
#define pinToUse 5 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
45-
//#define pinToUse 9 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
46-
//#define pinToUse 10 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
43+
// Pins tested OK in Nano Every ATmega4809
44+
#define pinToUse 5 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
45+
//#define pinToUse 9 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
46+
//#define pinToUse 10 // TimerA0, only accurate @ low frequencies (< 1KHz) because of low 250KHz clock
4747

48-
// Many pins to be used for TimerA0, provided same frequency, but different DC
49-
uint32_t PWM_Pins[] = { 5, 9, 10 };
48+
// Many pins to be used for TimerA0, provided same frequency, but different DC
49+
uint32_t PWM_Pins[] = { 5, 9, 10 };
5050

5151
#else
52-
#error TimerA0 to be used with Arduino megaAVR Core
52+
#error TimerA0 to be used with Arduino megaAVR Core
5353
#endif
5454

5555
////////////////////////////////////////////

0 commit comments

Comments
 (0)