Com: Make the comment length explicit
sendComment cannot send more than 62 bytes, as limited by the HID report. Sending more is prevented by vsnprintf, but change the function signature to make it explicit that the array passed to it should be at most 62 bytes.
This commit is contained in:
parent
69909851c2
commit
caff96922e
3 changed files with 3 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
.pio
|
.pio
|
||||||
.idea
|
**/.idea
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
*/
|
*/
|
||||||
namespace Com {
|
namespace Com {
|
||||||
void sendFigUpdate(int8_t event);
|
void sendFigUpdate(int8_t event);
|
||||||
void sendComment(const char* message, ...);
|
void sendComment(const char message[62], ...);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //JIN_BARBAPAPA_COM_H
|
#endif //JIN_BARBAPAPA_COM_H
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Com {
|
||||||
flushBuffer();
|
flushBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendComment(const char *message, ...) {
|
void sendComment(const char message[62], ...) {
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, message);
|
va_start(args, message);
|
||||||
buffer[0] = '#';
|
buffer[0] = '#';
|
||||||
|
|
Loading…
Add table
Reference in a new issue