mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-02 03:58:33 +08:00
fix write_len/read_len
This commit is contained in:
parent
6d49eaebf3
commit
5447f2fb8d
@ -58,15 +58,7 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(WIN32)
|
||||
#if !defined(NDEBUG)
|
||||
{
|
||||
AllocConsole();
|
||||
FILE* fp = NULL;
|
||||
freopen_s(&fp, "CONOUT$", "w+t", stdout);
|
||||
}
|
||||
#endif /*NDEBUG*/
|
||||
#endif /*WIN32*/
|
||||
TK_ENABLE_CONSOLE();
|
||||
|
||||
tk_init(lcd_w, lcd_h, APP_SIMULATOR, NULL, NULL);
|
||||
#endif
|
||||
|
@ -45,7 +45,7 @@ int32_t tk_istream_read_len(tk_istream_t* stream, uint8_t* buff, uint32_t max_si
|
||||
do {
|
||||
read_bytes = tk_istream_read(stream, buff + offset, remain_bytes);
|
||||
|
||||
if (read_bytes < 0) {
|
||||
if (read_bytes <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ int32_t tk_ostream_write_len(tk_ostream_t* stream, const uint8_t* buff, uint32_t
|
||||
do {
|
||||
write_bytes = tk_ostream_write(stream, buff + offset, remain_bytes);
|
||||
|
||||
if (write_bytes < 0) {
|
||||
if (write_bytes <= 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -329,4 +329,11 @@ typedef uint32_t (*tk_get_time_t)();
|
||||
typedef uint32_t (*tk_get_time_ms_t)();
|
||||
typedef void (*tk_sleep_ms_t)(uint32_t ms);
|
||||
|
||||
#if defined(WIN32) && !defined(NDEBUG)
|
||||
#define TK_ENABLE_CONSOLE() {AllocConsole(); FILE* fp = NULL; freopen_s(&fp, "CONOUT$", "w+t", stdout);}
|
||||
#else
|
||||
#define TK_ENABLE_CONSOLE()
|
||||
#endif /*WIN32 && !NDEBUG*/
|
||||
|
||||
|
||||
#endif /*TYPES_DEF_H*/
|
||||
|
Loading…
Reference in New Issue
Block a user