Skip to content

Commit 91a3bef

Browse files
committed
Add proper error return
1 parent d148d40 commit 91a3bef

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/ANTPLUS_Defines.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
// Errors
1111
#define ANTPLUS_RESET_RADIO_FAILED 1
1212
#define ANTPLUS_MAX_CHANNEL_CHECK_FAILED 2
13+
#define ANTPLUS_NO_MORE_CHANNELS 255
1314

1415
// State
1516
#define ANTPLUS_DRIVER_STATE_UNKNOWN 0
@@ -19,4 +20,4 @@
1920
#define ANTPLUS_RESET_NO_WAIT_FOR_STARTUP 0
2021
#define ANTPLUS_RESET_WAIT_FOR_STARTUP 1
2122

22-
#endif // ANTPLUS_DEFINES_h
23+
#endif // ANTPLUS_DEFINES_h

src/MainClasses/ANTPLUS_AntPlusRouter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ uint8_t AntPlusRouter::addProfileToNextChannel(BaseProfile* profile) {
9797
return i;
9898
}
9999
}
100-
return 255; //TODO change this to a define
100+
return ANTPLUS_NO_MORE_CHANNELS;
101101
}
102102

103103
void AntPlusRouter::loop() {

src/MainClasses/ANTPLUS_AntPlusRouter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AntPlusRouter {
3131
/**
3232
* Associates a profile with the next lowest available channel
3333
* returns associated channel, if all channels full then it
34-
* returns TODO
34+
* returns ANTPLUS_NO_MORE_CHANNELS
3535
*/
3636
uint8_t addProfileToNextChannel(BaseProfile* profile);
3737
/**

0 commit comments

Comments
 (0)