Skip to content

Commit 0fe2536

Browse files
committed
fix: update libxr stdio print calls
1 parent b588ab5 commit 0fe2536

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
3232
int main() {
3333
LibXR::PlatformInit();
34-
LibXR::STDIO::Printf("This is XRobot Module Template Test\n");
34+
LibXR::STDIO::Printf<"This is XRobot Module Template Test\n">();
3535
LibXR::HardwareContainer hw;
3636
XRobotMain(hw);
3737
return 0;

SharedTopic.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ class SharedTopic : public LibXR::Application {
9393

9494
static int CommandFunc(SharedTopic* self, int argc, char** argv) {
9595
if (argc == 1) {
96-
LibXR::STDIO::Printf("Usage:\r\n");
97-
LibXR::STDIO::Printf(
98-
" monitor [time_ms] [interval_ms] - test received speed\r\n");
96+
LibXR::STDIO::Printf<"Usage:\r\n">();
97+
LibXR::STDIO::Printf<" monitor [time_ms] [interval_ms] - test received speed\r\n">();
9998
return 0;
10099
} else if (argc == 4) {
101100
if (strcmp(argv[1], "monitor") == 0) {
@@ -104,15 +103,14 @@ class SharedTopic : public LibXR::Application {
104103
auto start = self->rx_count_;
105104
while (time > 0) {
106105
LibXR::Thread::Sleep(delay);
107-
LibXR::STDIO::Printf(
108-
"%f Mbps\r\n", static_cast<float>(self->rx_count_ - start) * 8.0 /
106+
LibXR::STDIO::Printf<"%f Mbps\r\n">(static_cast<float>(self->rx_count_ - start) * 8.0 /
109107
1024.0 / 1024.0 / delay * 1000.0);
110108
time -= delay;
111109
start = self->rx_count_;
112110
}
113111
}
114112
} else {
115-
LibXR::STDIO::Printf("Error: Invalid arguments.\r\n");
113+
LibXR::STDIO::Printf<"Error: Invalid arguments.\r\n">();
116114
return -1;
117115
}
118116

0 commit comments

Comments
 (0)