Skip to content

Commit

Permalink
Merge branch 'size' into 'main'
Browse files Browse the repository at this point in the history
size_t to std::size_t

See merge request bolderflight/software/pwm!19
  • Loading branch information
flybrianfly committed Dec 17, 2021
2 parents a9e1391 + bee758c commit 948929b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## v6.0.1
- size_t to std::size_t

## v6.0.0
- Updated to work with Arduino and CMake

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (DEFINED MCU)
set(CMAKE_TOOLCHAIN_FILE "${mcu_support_SOURCE_DIR}/cmake/cortex.cmake")
# Project information
project(Pwm
VERSION 6.0.0
VERSION 6.0.1
DESCRIPTION "PWM actuator library"
LANGUAGES CXX
)
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Bolder Flight Systems PWM
version=6.0.0
version=6.0.1
author=Brian Taylor <[email protected]>
maintainer=Brian Taylor <[email protected]>
sentence=Library for sending commands to PWM servos.
Expand Down
4 changes: 2 additions & 2 deletions src/pwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ class PwmTx {
void Begin(const float freq) {
pwm_period_us_ = 1.0f / freq * 1000000.0f;
/* Set the period and frequency */
for (size_t i = 0; i < N; i++) {
for (std::size_t i = 0; i < N; i++) {
analogWriteFrequency(pins_[i], freq);
}
}
void Write() {
for (size_t i = 0; i < N; i++) {
for (std::size_t i = 0; i < N; i++) {
analogWrite(pins_[i], static_cast<float>(ch_[i]) /
pwm_period_us_ * MAX_VAL_);
}
Expand Down

0 comments on commit 948929b

Please sign in to comment.