syslink_main: remove empty lines and struct keyword

This commit is contained in:
Matthias Grob
2020-08-25 19:44:35 +02:00
parent d82f325f8d
commit 180c6faf4a
2 changed files with 2 additions and 27 deletions
@@ -219,8 +219,6 @@ Syslink::update_params(bool force_set)
this->_params_update[2] = t; this->_params_update[2] = t;
this->_params_ack[2] = 0; this->_params_ack[2] = 0;
} }
} }
// 1M 8N1 serial connection to NRF51 // 1M 8N1 serial connection to NRF51
@@ -363,7 +361,7 @@ Syslink::task_main()
} }
if (fds[1].revents & POLLIN) { if (fds[1].revents & POLLIN) {
struct parameter_update_s update; parameter_update_s update;
orb_copy(ORB_ID(parameter_update), _params_sub, &update); orb_copy(ORB_ID(parameter_update), _params_sub, &update);
update_params(false); update_params(false);
} }
@@ -372,7 +370,6 @@ Syslink::task_main()
} }
close(_fd); close(_fd);
} }
void void
@@ -497,7 +494,6 @@ Syslink::handle_message(syslink_message_t *msg)
} else if (_params_ack[2] == 0 && t - _params_update[2] > 10000) { } else if (_params_ack[2] == 0 && t - _params_update[2] > 10000) {
set_address(_addr); set_address(_addr);
} }
} }
void void
@@ -515,7 +511,6 @@ Syslink::handle_radio(syslink_message_t *sys)
} else if (sys->type == SYSLINK_RADIO_ADDRESS) { } else if (sys->type == SYSLINK_RADIO_ADDRESS) {
_params_ack[2] = t; _params_ack[2] = t;
} }
} }
void void
@@ -602,7 +597,6 @@ Syslink::handle_bootloader(syslink_message_t *sys)
c->data[22] = 0x10; // Protocol version c->data[22] = 0x10; // Protocol version
send_message(sys); send_message(sys);
} }
} }
void void
@@ -797,7 +791,6 @@ void status()
} }
printf("\n\n"); printf("\n\n");
} }
close(deckfd); close(deckfd);
@@ -827,20 +820,13 @@ void attached(int pid)
exit(found ? 1 : 0); exit(found ? 1 : 0);
} }
void test() void test()
{ {
// TODO: Ensure battery messages are recent // TODO: Ensure battery messages are recent
// TODO: Read and write from memory to ensure it is working // TODO: Read and write from memory to ensure it is working
} }
} // namespace syslink
}
int syslink_main(int argc, char *argv[]) int syslink_main(int argc, char *argv[])
{ {
@@ -849,7 +835,6 @@ int syslink_main(int argc, char *argv[])
exit(1); exit(1);
} }
const char *verb = argv[1]; const char *verb = argv[1];
if (!strcmp(verb, "start")) { if (!strcmp(verb, "start")) {
@@ -873,9 +858,6 @@ int syslink_main(int argc, char *argv[])
syslink::test(); syslink::test();
} }
syslink::usage(); syslink::usage();
exit(1); exit(1);
@@ -52,7 +52,6 @@ using namespace time_literals;
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) #define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
typedef enum { typedef enum {
BAT_DISCHARGING = 0, BAT_DISCHARGING = 0,
BAT_CHARGING = 1, BAT_CHARGING = 1,
@@ -82,7 +81,6 @@ public:
int txrate; int txrate;
private: private:
friend class SyslinkBridge; friend class SyslinkBridge;
friend class SyslinkMemory; friend class SyslinkMemory;
@@ -153,7 +151,6 @@ private:
static int task_main_trampoline(int argc, char *argv[]); static int task_main_trampoline(int argc, char *argv[]);
void task_main(); void task_main();
}; };
@@ -174,11 +171,9 @@ public:
void pipe_message(crtp_message_t *msg); void pipe_message(crtp_message_t *msg);
protected: protected:
virtual pollevent_t poll_state(struct file *filp); virtual pollevent_t poll_state(struct file *filp);
private: private:
Syslink *_link; Syslink *_link;
// Stores data that was received from syslink but not yet read by another driver // Stores data that was received from syslink but not yet read by another driver
@@ -186,7 +181,6 @@ private:
crtp_message_t _msg_to_send; crtp_message_t _msg_to_send;
int _msg_to_send_size_remaining; int _msg_to_send_size_remaining;
}; };
@@ -219,5 +213,4 @@ private:
int write(int i, uint16_t addr, const char *buf, int length); int write(int i, uint16_t addr, const char *buf, int length);
void sendAndWait(); void sendAndWait();
}; };