-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ミッションインターフェース基板追加 #22
Conversation
771-8bit
commented
Feb 24, 2024
- アップリンクでのミッション系のON/OFF機能
- ミッション系のCAN Inspector機能
Main/Main.ino
Outdated
@@ -340,6 +345,13 @@ void loop() { | |||
if (uplink == "valve-check") { | |||
Serial_Valve.print("valve-check\n"); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
CCP.read_device(); | ||
if (CCP.id < 0x40) { | ||
CCP.string(str_buf, 7); | ||
sprintf(msgString, "%d,ID,%03x,time,%d000,string,%s,,,,", millis(), CCP.id, CCP.time16(), str_buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Never use sprintf. Use snprintf instead. [runtime/printf] [5]
CCP.string(str_buf, 7); | ||
sprintf(msgString, "%d,ID,%03x,time,%d000,string,%s,,,,", millis(), CCP.id, CCP.time16(), str_buf); | ||
} else if (CCP.id < 0x80) { | ||
sprintf(msgString, "%d,ID,%03x,time,%lu,uint32,%lu,,,,", millis(), CCP.id, CCP.time32(), CCP.data_uint32()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Never use sprintf. Use snprintf instead. [runtime/printf] [5]
} else if (CCP.id < 0x80) { | ||
sprintf(msgString, "%d,ID,%03x,time,%lu,uint32,%lu,,,,", millis(), CCP.id, CCP.time32(), CCP.data_uint32()); | ||
} else if (CCP.id < 0xC0) { | ||
sprintf(msgString, "%d,ID,%03x,time,%lu,float,%8.2f,,,,", millis(), CCP.id, CCP.time32(), CCP.data_float()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Never use sprintf. Use snprintf instead. [runtime/printf] [5]
} else if (CCP.id < 0xC0) { | ||
sprintf(msgString, "%d,ID,%03x,time,%lu,float,%8.2f,,,,", millis(), CCP.id, CCP.time32(), CCP.data_float()); | ||
} else { | ||
sprintf(msgString, "%d,ID,%03x,time,%d000,fp16_0,%8.2f,fp16_1,%8.2f,fp16_2,%8.2f", millis(), CCP.id, CCP.time16(), CCP.data_fp16_0(), CCP.data_fp16_1(), CCP.data_fp16_2()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Never use sprintf. Use snprintf instead. [runtime/printf] [5]
} | ||
Serial.println(msgString); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Could not find a newline character at the end of the file. [whitespace/ending_newline] [5]
CCP.read_device(); | ||
if (CCP.id < 0x40) { | ||
CCP.string(str_buf, 7); | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%d000,string,%s,,,,", millis(), CCP.id, CCP.time16(), str_buf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
If you can, use sizeof(msgString) instead of 128 as the 2nd arg to snprintf. [runtime/printf] [3]
CCP.string(str_buf, 7); | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%d000,string,%s,,,,", millis(), CCP.id, CCP.time16(), str_buf); | ||
} else if (CCP.id < 0x80) { | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%lu,uint32,%lu,,,,", millis(), CCP.id, CCP.time32(), CCP.data_uint32()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
If you can, use sizeof(msgString) instead of 128 as the 2nd arg to snprintf. [runtime/printf] [3]
} else if (CCP.id < 0x80) { | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%lu,uint32,%lu,,,,", millis(), CCP.id, CCP.time32(), CCP.data_uint32()); | ||
} else if (CCP.id < 0xC0) { | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%lu,float,%8.2f,,,,", millis(), CCP.id, CCP.time32(), CCP.data_float()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
If you can, use sizeof(msgString) instead of 128 as the 2nd arg to snprintf. [runtime/printf] [3]
} else if (CCP.id < 0xC0) { | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%lu,float,%8.2f,,,,", millis(), CCP.id, CCP.time32(), CCP.data_float()); | ||
} else { | ||
snprintf(msgString, 128, "%d,ID,%03x,time,%d000,fp16_0,%8.2f,fp16_1,%8.2f,fp16_2,%8.2f", millis(), CCP.id, CCP.time16(), CCP.data_fp16_0(), CCP.data_fp16_1(), CCP.data_fp16_2()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
If you can, use sizeof(msgString) instead of 128 as the 2nd arg to snprintf. [runtime/printf] [3]