diff options
author | stijn <stinos@zoho.com> | 2015-10-25 12:40:24 +0100 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-10-25 15:42:19 +0300 |
commit | ca9eb81d0b8624bfee6dac7b062747b01e8aeb4b (patch) | |
tree | aaacbb8e8f7ee19f6c3901344965f27e04e58a13 /windows/sleep.h | |
parent | 1c55310bcced133fa4efc1546c0001f3ae4a9fc6 (diff) | |
download | micropython-ca9eb81d0b8624bfee6dac7b062747b01e8aeb4b.tar.gz micropython-ca9eb81d0b8624bfee6dac7b062747b01e8aeb4b.zip |
windows: Add usleep() implementation for msvc port
Also make sleep.c self-contained by moving initialization code,
instead of having part of the code in init.c, and add a header file
to accomodate this.
msec_sleep() now uses the usleep() implementation as well.
Diffstat (limited to 'windows/sleep.h')
-rw-r--r-- | windows/sleep.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/windows/sleep.h b/windows/sleep.h new file mode 100644 index 0000000000..09ad4afdca --- /dev/null +++ b/windows/sleep.h @@ -0,0 +1,32 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2015 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +void init_sleep(void); +void deinit_sleep(void); +void msec_sleep(double msec); +#ifdef _MSC_VER +int usleep(__int64 usec); +#endif |