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
|
#endif
|
||||||
|
|
||||||
#if defined(WIN32)
|
TK_ENABLE_CONSOLE();
|
||||||
#if !defined(NDEBUG)
|
|
||||||
{
|
|
||||||
AllocConsole();
|
|
||||||
FILE* fp = NULL;
|
|
||||||
freopen_s(&fp, "CONOUT$", "w+t", stdout);
|
|
||||||
}
|
|
||||||
#endif /*NDEBUG*/
|
|
||||||
#endif /*WIN32*/
|
|
||||||
|
|
||||||
tk_init(lcd_w, lcd_h, APP_SIMULATOR, NULL, NULL);
|
tk_init(lcd_w, lcd_h, APP_SIMULATOR, NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -45,7 +45,7 @@ int32_t tk_istream_read_len(tk_istream_t* stream, uint8_t* buff, uint32_t max_si
|
|||||||
do {
|
do {
|
||||||
read_bytes = tk_istream_read(stream, buff + offset, remain_bytes);
|
read_bytes = tk_istream_read(stream, buff + offset, remain_bytes);
|
||||||
|
|
||||||
if (read_bytes < 0) {
|
if (read_bytes <= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ int32_t tk_ostream_write_len(tk_ostream_t* stream, const uint8_t* buff, uint32_t
|
|||||||
do {
|
do {
|
||||||
write_bytes = tk_ostream_write(stream, buff + offset, remain_bytes);
|
write_bytes = tk_ostream_write(stream, buff + offset, remain_bytes);
|
||||||
|
|
||||||
if (write_bytes < 0) {
|
if (write_bytes <= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,4 +329,11 @@ typedef uint32_t (*tk_get_time_t)();
|
|||||||
typedef uint32_t (*tk_get_time_ms_t)();
|
typedef uint32_t (*tk_get_time_ms_t)();
|
||||||
typedef void (*tk_sleep_ms_t)(uint32_t ms);
|
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*/
|
#endif /*TYPES_DEF_H*/
|
||||||
|
Loading…
Reference in New Issue
Block a user