mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Compare commits
2
Commits
52cf759bec
...
025f72c876
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
025f72c876 | ||
|
|
7a7ffd3bf8 |
@@ -125,6 +125,7 @@ extern __xdata struct uip_eth_addr uip_ethaddr;
|
||||
|
||||
// Headers for calls in the common code area (HOME/BANK0)
|
||||
void print_string_no_syslog(__code char *p);
|
||||
void print_string_newline_no_syslog(__code char *p);
|
||||
void print_string(__code char *p);
|
||||
void print_string_x(__xdata char *p);
|
||||
void print_long(uint32_t a);
|
||||
|
||||
@@ -289,6 +289,12 @@ void print_string_no_syslog(__code char *p)
|
||||
write_char_no_syslog(*p++);
|
||||
}
|
||||
|
||||
void print_string_newline_no_syslog(__code char *p)
|
||||
{
|
||||
write_char_no_syslog('\n');
|
||||
print_string_no_syslog(p);
|
||||
}
|
||||
|
||||
void print_string_x(__xdata char *p)
|
||||
{
|
||||
while (*p)
|
||||
|
||||
@@ -30,16 +30,16 @@ void syslog_start(void) __banked
|
||||
uip_ipaddr(server_ip, state.server_ip[0], state.server_ip[1], state.server_ip[2], state.server_ip[3]);
|
||||
state.syslog_conn = uip_udp_new(&server_ip, HTONS(514));
|
||||
if (state.syslog_conn == 0) {
|
||||
print_string_no_syslog("Failed to create a new UDP client\n");
|
||||
print_string_newline_no_syslog("Failed to create a new UDP client");
|
||||
return;
|
||||
}
|
||||
print_string_no_syslog("Started syslog to IP ");
|
||||
print_string_newline_no_syslog("Started syslog to IP ");
|
||||
itoa(state.server_ip[0]); write_char('.'); itoa(state.server_ip[1]); write_char('.');
|
||||
itoa(state.server_ip[2]); write_char('.'); itoa(state.server_ip[3]); write_char('\n');
|
||||
state.enabled = 1;
|
||||
}
|
||||
else {
|
||||
print_string_no_syslog("Syslog is already running\n");
|
||||
print_string_newline_no_syslog("Syslog is already running");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ void syslog_stop(void) __banked
|
||||
if (state.syslog_conn != 0) {
|
||||
uip_udp_remove(state.syslog_conn);
|
||||
state.syslog_conn = 0;
|
||||
print_string_no_syslog("Stopped syslog\n");
|
||||
print_string_newline_no_syslog("Stopped syslog");
|
||||
} else {
|
||||
print_string_no_syslog("Syslog is not running\n");
|
||||
print_string_newline_no_syslog("Syslog is not running");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user