Skip to content

Commit 5e998da

Browse files
committed
Rename function to avoid future naming collisions
1 parent 791f67b commit 5e998da

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/MainClasses/ANTPLUS_AntPlusRouter.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ void AntPlusRouter::setProfile(uint8_t channel, BaseProfile* profile) {
6868
profile->setRouter(this);
6969
}
7070

71-
void AntPlusRouter::removeProfile(uint8_t channel) {
71+
void AntPlusRouter::removeProfileByChannel(uint8_t channel) {
72+
if (channel >= ANTPLUS_MAX_CHANNELS_POSSIBLE) {
73+
return;
74+
}
7275
if (_profiles[channel]) {
7376
_profiles[channel]->stop();
7477
_profiles[channel]->setChannelNumber(0);
@@ -82,7 +85,7 @@ void AntPlusRouter::removeProfile(uint8_t channel) {
8285

8386
void AntPlusRouter::removeAllProfiles() {
8487
for (uint8_t i = 0; i < ANTPLUS_MAX_CHANNELS_POSSIBLE; i++) {
85-
removeProfile(i);
88+
removeProfileByChannel(i);
8689
}
8790
}
8891

src/MainClasses/ANTPLUS_AntPlusRouter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class AntPlusRouter {
3939
* Unassigns channel
4040
* Removes the profile from index
4141
*/
42-
void removeProfile(uint8_t channel);
42+
void removeProfileByChannel(uint8_t channel);
4343
/**
4444
* Stops all profiles
4545
* Unassigns all channels

0 commit comments

Comments
 (0)