mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-13 03:30:31 +00:00
chario: Move static variable to class.
This commit is contained in:
parent
97727e0d1e
commit
1e587b0848
@ -206,8 +206,6 @@ void CharIoStdin::rcv_disable()
|
|||||||
|
|
||||||
bool CharIoStdin::rcv_char_available()
|
bool CharIoStdin::rcv_char_available()
|
||||||
{
|
{
|
||||||
static int consecutivechars = 0;
|
|
||||||
|
|
||||||
if (consecutivechars >= 15) {
|
if (consecutivechars >= 15) {
|
||||||
consecutivechars++;
|
consecutivechars++;
|
||||||
if (consecutivechars >= 400)
|
if (consecutivechars >= 400)
|
||||||
@ -340,8 +338,6 @@ void CharIoSocket::rcv_disable()
|
|||||||
|
|
||||||
bool CharIoSocket::rcv_char_available()
|
bool CharIoSocket::rcv_char_available()
|
||||||
{
|
{
|
||||||
static int consecutivechars = 0;
|
|
||||||
|
|
||||||
if (consecutivechars >= 15) {
|
if (consecutivechars >= 15) {
|
||||||
consecutivechars++;
|
consecutivechars++;
|
||||||
if (consecutivechars >= 800)
|
if (consecutivechars >= 800)
|
||||||
@ -406,7 +402,7 @@ bool CharIoSocket::rcv_char_available_now()
|
|||||||
memset(&acceptfdaddr, 0, sizeof(acceptfdaddr));
|
memset(&acceptfdaddr, 0, sizeof(acceptfdaddr));
|
||||||
socklen_t len = sizeof(acceptfdaddr);
|
socklen_t len = sizeof(acceptfdaddr);
|
||||||
acceptfd = accept(sockfd, (struct sockaddr *) &acceptfdaddr, &len);
|
acceptfd = accept(sockfd, (struct sockaddr *) &acceptfdaddr, &len);
|
||||||
if (acceptfd == -1){
|
if (acceptfd == -1) {
|
||||||
LOG_F(INFO, "socket accept err: %s", strerror(errno));
|
LOG_F(INFO, "socket accept err: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -456,7 +452,13 @@ int CharIoSocket::xmit_char(uint8_t c)
|
|||||||
LOG_F(INFO, "socket accept write err: %s", strerror(errno));
|
LOG_F(INFO, "socket accept write err: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
if (sent == 1) {
|
if (sent == 1) {
|
||||||
// LOG_F(INFO, "socket accept write '%c'", c);
|
/*
|
||||||
|
if (c < ' ') {
|
||||||
|
LOG_F(INFO, "socket accept write '\\x%02X'", c);
|
||||||
|
} else {
|
||||||
|
LOG_F(INFO, "socket accept write '%c'", c);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG_F(INFO, "socket accept write %d", sent);
|
LOG_F(INFO, "socket accept write %d", sent);
|
||||||
@ -476,7 +478,17 @@ int CharIoSocket::rcv_char(uint8_t *c)
|
|||||||
LOG_F(INFO, "socket accept read err: %s", strerror(errno));
|
LOG_F(INFO, "socket accept read err: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
else if (received == 1) {
|
else if (received == 1) {
|
||||||
// LOG_F(INFO, "socket accept read '%c'", c ? *c : 0);
|
/*
|
||||||
|
if (c) {
|
||||||
|
if (*c < ' ') {
|
||||||
|
LOG_F(INFO, "socket accept write '\\x%02X'", *c);
|
||||||
|
} else {
|
||||||
|
LOG_F(INFO, "socket accept read '%c'", *c);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LOG_F(INFO, "socket accept read %d", received);
|
||||||
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG_F(INFO, "socket accept read %d", received);
|
LOG_F(INFO, "socket accept read %d", received);
|
||||||
|
@ -81,6 +81,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
static void mysig_handler(int signum);
|
static void mysig_handler(int signum);
|
||||||
bool stdio_inited;
|
bool stdio_inited;
|
||||||
|
int consecutivechars = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Socket character I/O backend. */
|
/** Socket character I/O backend. */
|
||||||
@ -101,6 +102,7 @@ private:
|
|||||||
int sockfd = -1;
|
int sockfd = -1;
|
||||||
int acceptfd = -1;
|
int acceptfd = -1;
|
||||||
const char* path = 0;
|
const char* path = 0;
|
||||||
|
int consecutivechars = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHAR_IO_H
|
#endif // CHAR_IO_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user