aboutsummaryrefslogtreecommitdiff
path: root/ports/windows
AgeCommit message (Collapse)Author
2021-04-23windows/mpconfigport.h: Enable features also present in unix port.stijn
2021-03-12tests: Rename run-tests to run-tests.py for consistency.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2021-02-02windows/msvc: Use same default python command as core.stijn
2021-02-02tests/run-tests: Change default Python command used on Windows.stijn
Default to just calling python since that is most commonly available: the official installer or zipfiles from python.org, anaconda, nupkg all result in python being available but not python3. In other words: the default used so far is wrong. Note that os.name is 'posix' when running the python version which comes with Cygwin or MSys2 so they are not affected by this. However of all possible ways to get Python on Windows, only Cygwin provides no python command so update the default way for running tests in the README.
2020-11-13unix: Make mp_hal_delay_ms run MICROPY_EVENT_POLL_HOOK.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2020-10-01unix,windows: Implement mp_hal_time_ns using gettimeofday.Damien George
This provides microsecond accuracy. Signed-off-by: Damien George <damien@micropython.org>
2020-09-23windows: Update build instructions in README.stijn
Make the instructions more complete by documenting all needed steps for starting from scratch. Also add a section for MSYS2 since the Travis build uses it as well and it's a good alternative for Cygwin. Remove the mingw32 reference since it's not readily available anymore in most Linux distros nor compiles successfully.
2020-09-11windows: Show test failures in the Appveyor builds.stijn
2020-09-11windows/Makefile: Support freezing modules.stijn
Alter the build flags as needed to support freezing modules with a manifest. This makes freezing works just like it does for e.g. the unix port.
2020-09-11windows/msvc: Support freezing modules.stijn
Support freezing modules via manifest.py for consistency with the other ports. In essence this comes down to calling makemanifest.py and adding the resulting .c file to the build. Note the file with preprocessed qstrs has been renamed to match what makemanifest.py expects and which is also the name all other ports use.
2020-09-11py: Fix handling of NaN in certain pow implementations.stijn
Adds a new compile-time option MICROPY_PY_MATH_POW_FIX_NAN for use with toolchains that don't handle pow-of-NaN correctly.
2020-09-01extmod/vfs: Add option to use 1970 as Epoch.Damien George
By setting MICROPY_EPOCH_IS_1970 a port can opt to use 1970/1/1 as the Epoch for timestamps returned by stat(). And this setting is enabled on the unix and windows ports because that's what they use. Signed-off-by: Damien George <damien@micropython.org>
2020-05-28windows: Make appveyor.yml self-contained.stijn
Add configuration which otherwise has to be set via the UI so the file is more self-contained, and remove configuration which is not needed because it's the same as the default. The major change here is that for a while now Appveyor has been using Visual Studio 2015 by default while we still want to support 2013.
2020-05-28py/modmath: Work around msvc float bugs in atan2, fmod and modf.stijn
Older implementations deal with infinity/negative zero incorrectly. This commit adds generic fixes that can be enabled by any port that needs them, along with new tests cases.
2020-04-29all: Factor gchelper code to one place and use it for unix & ARM ports.Jim Mussared
No functionality change is intended with this commit, it just consolidates the separate implementations of GC helper code to the lib/utils/ directory as a general set of helper functions useful for any port. This reduces duplication of code, and makes it easier for future ports or embedders to get the GC implementation correct. Ports should now link against gchelper_native.c and either gchelper_m0.s or gchelper_m3.s (currently only Cortex-M is supported but other architectures can follow), or use the fallback gchelper_generic.c which will work on x86/x64/ARM. The gc_helper_get_sp function from gchelper_m3.s is not really GC related and was only used by cc3200, so it has been moved to that port and renamed to cortex_m3_get_sp.
2020-04-23all: Format code to add space after C++-style comment start.stijn
Note: the uncrustify configuration is explicitly set to 'add' instead of 'force' in order not to alter the comments which use extra spaces after // as a means of indenting text for clarity.
2020-04-18all: Enable extra conversion warnings where applicable.stijn
Add -Wdouble-promotion and -Wfloat-conversion for most ports to ban out implicit floating point conversions, and add extra Travis builds using MICROPY_FLOAT_IMPL_FLOAT to uncover warnings which weren't found previously. For the unix port -Wsign-comparison is added as well but only there since only clang supports this but gcc doesn't.
2020-04-18all: Fix implicit floating point to integer conversions.stijn
These are found when building with -Wfloat-conversion.
2020-04-05windows: Update genhdr.targets to match makeqstrdefs.py args.Jim Mussared
2020-03-28all: Remove spaces inside and around parenthesis.Damien George
Using new options enabled in the uncrustify configuration.
2020-03-25windows/windows_mphal: Fix missing semicolon.David Lechner
2020-03-25unix,windows: Use STDIN_FILENO, STDOUT_FILENO macros where appropriate.David Lechner
This replaces 0 and 1 with STDIN_FILENO and STDOUT_FILENO to make the intention of the code clearer.
2020-03-25windows: Remove custom definition of MP_PLAT_PRINT_STRN.David Lechner
This removes the port-specific definition of MP_PLAT_PRINT_STRN on the windows port, so that the default mp_hal_stdout_tx_strn_cooked() is always used. This fixes releasing the GIL during the call to write() (this was missed in bc3499f0103abcae39ad048bb42a518a665b8497). Also, mp_hal_dupterm_tx_strn() was defined but never used anywhere so it is safe to delete it.
2020-03-25windows/msvc: Fix warnings regarding function declarations.stijn
Fix missing mkdir and gettimeofday declarations, then silence msvc-specific compiler warning C4996: 'The POSIX name for this item is deprecated'.
2020-03-18unix: Remove custom file implementation to use extmod's VFS POSIX one.Damien George
The implementation in extmod/vfs_posix_file.c is now equivalent to that in ports/unix/file.c, so remove the latter and use the former instead.
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-11windows: Improve default search path.stijn
The default value for MICROPYPATH used in unix/main.c is "~/.micropython/lib:/usr/lib/micropython" which has 2 problems when used in the Windows port: - it has a ':' as path separator but the port uses ';' so the entire string is effectively discarded since it gets interpreted as a single path which doesn't exist - /usr/lib/micropython is not a valid path in a standard Windows environment Override the value with a suitable default.
2020-02-07unix, windows: Use mp_keyboard_interrupt instead of custom code.Damien George
The mp_keyboard_interrupt() function does exactly what is needed here, and using it gets ctrl-C working when MICROPY_ENABLE_SCHEDULER is enabled on these ports (and MICROPY_ASYNC_KBD_INTR is disabled).
2020-01-26windows/windows_mphal: Release GIL during system calls.David Lechner
This releases the GIL during syscalls that could block.
2020-01-22windows: Support word-based move/delete key sequences for REPL.stijn
Translate common Ctrl-Left/Right/Delete/Backspace to the EMACS-style sequences (i.e. Alt key based) for forward-word, backward-word, forwad-kill and backward-kill. Requires MICROPY_REPL_EMACS_WORDS_MOVE to be defined so the readline implementation interprets these.
2019-10-22unix,windows: Enable module weak links.Damien George
2019-09-18mpy-cross,windows: Add msvc build of mpy-cross.stijn
Add the project file to the mpy-cross directory, which is also where the executable ends up, and change the Appveyor settings to build mpy-cross with both msvc and mingw-w64 and verify this all works by running tests with --via-mpy.
2019-09-18windows: Default to binary mode for files.stijn
If this is not set it might default to calls to open() to use text mode which is usually not wanted, and even wrong and leading to incorrect results when loading binary .mpy files. This also means that text files written and read will not have line-ending translation from \n to \r\n and vice-versa anymore. This shouldn't be much of a problem though since most tools dealing with text files adapt automatically to any of the 2 formats.
2019-09-18windows/msvc: Change the way sources are listed.stijn
Reserve sources.props for listing just the MicroPython core and extmod files, similar to how py.mk lists port-independent source files. This allows reusing the source list, for instance for building mpy-cross. The sources for building the executable itself are listed in the corresponding project file, similar to how the other ports specify the source files in their Makefile.
2019-09-18windows/msvc: Enable overriding directories used in the build.stijn
Append to PyIncDirs, used to define include directories specific to MicroPython, instead of just overwriting it so project files importing this file can define additional directories. And allow defining the target directory for the executable instead of hardcoding it to the windows directory. Main reason for this change is that it will allow building mpy-cross with msvc.
2019-09-18windows/msvc: Move build options from .vcxproj to .props files.stijn
We want the .vcxproj to be just a container with the minimum content for making it work as a project file for Visual Studio and MSBuild, whereas the actual build options and actions get placed in separate reusable files. This was roughly the case already except some compiler options were overlooked; fix this here: we'll need those common options when adding a project file for building mpy-cross.
2019-09-18windows/msvc: Remove unneeded definitions for qstr generation.stijn
These were probably added to detect more qstrs but as long as the micropython executable itself doesn't use the same build options the qstrs would be unused anyway. Furthermore these definitions are for internal use and get enabled when corresponding MICROPY_EMIT_XXX are defined, in which case the compiler would warn about symbol redefinitions since they'd be defined both here and in the source.
2019-09-10windows/Makefile: Make use of CFLAGS_EXTRA, LDFLAGS_EXTRA and SRC_MOD.Andrew Leech
To be consistent with the unix port.
2019-09-03windows/msvc: Treat compiler warnings as errors.stijn
This is consistent with the other ports and helps catching problems early.
2019-08-17py/modmath: Implement math.isclose() for non-complex numbers.stijn
As per PEP 485, this function appeared in for Python 3.5. Configured via MICROPY_PY_MATH_ISCLOSE which is disabled by default, but enabled for the ports which already have MICROPY_PY_MATH_SPECIAL_FUNCTIONS enabled.
2019-07-19windows/mpconfigport.h: Don't define restrict/inline/alignof for C++.stijn
The C++ standard forbids redefining keywords, like inline and alignof, so guard these definitions to avoid that, allowing to include the MicroPython headers by C++ code.
2019-07-01windows/mpconfigport.h: Define empty MP_WEAK symbol.Damien George
2019-05-23windows: Fix line wrapping behaviour on the REPL.stijn
This enables going back to previous wrapped lines using backspace or left arrow: instead of just sticking to the beginning of a line, the cursor will move a line up.
2019-03-08py: Allow registration of modules at their definition.Andrew Leech
During make, makemoduledefs.py parses the current builds c files for MP_REGISTER_MODULE(module_name, obj_module, enabled_define) These are used to generate a header with the required entries for "mp_rom_map_elem_t mp_builtin_module_table[]" in py/objmodule.c
2018-12-15windows: Remove remaining traces of old GNU readline support.Damien George
GNU readline support for the unix port was removed in acaa30b6046d449f5f58a8f02c83459702759df7 and in 5e83a75c78dc8c370b25e7ee669295854ea45130, so it's also no longer supported in the windows port.
2018-10-05windows/msvc: Implement file/directory type query.stijn
Add some more POSIX compatibility by adding a d_type field to the dirent structure and defining corresponding macros so listdir_next in the unix' port modos.c can use it, end result being uos.ilistdir now reports the file type.
2018-10-05windows/msvc: Fix incorrect indentation in dirent.c.stijn
2018-08-14windows/msvc: Support custom compiler for header generation.stijn
Use overrideable properties instead of hardcoding the use of the default cl executable used by msvc toolsets. This allows using arbitrary compiler commands for qstr header generation. The CLToolExe and CLToolPath properties are used because they are, even though absent from any official documentation, the de-facto standard as used by the msvc toolsets themselves.
2018-08-02py/mpconfig.h: Introduce MICROPY_DEBUG_PRINTER for debugging output.Damien George
This patch in effect renames MICROPY_DEBUG_PRINTER_DEST to MICROPY_DEBUG_PRINTER, moving its default definition from lib/utils/printf.c to py/mpconfig.h to make it official and documented, and makes this macro a pointer rather than the actual mp_print_t struct. This is done to get consistency with MICROPY_ERROR_PRINTER, and provide this macro for use outside just lib/utils/printf.c. Ports are updated to use the new macro name.
2018-07-05windows: Make printing of debugging info work out of the box.stijn
Printing debugging info by defining MICROPY_DEBUG_VERBOSE expects a definition of the DEBUG_printf function which is readily available in printf.c so include that file in the build. Before this patch one would have to manually provide such definition which is tedious. For the msvc port disable MICROPY_USE_INTERNAL_PRINTF though: the linker provides no (easy) way to replace printf with the custom version as defined in printf.c.