summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-06-20 10:56:05 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-06-20 10:56:05 -0700
commit30ee7019ca651bce1fe966c1089fe977d51dc92b (patch)
tree0114b6f744dd175b7722dd8edcbe24f4ee84bb45 /windows
parent97fcdfbd08c922efd7470d6482d7c7c703ffc0ae (diff)
parent869cdcfdfc860b1177baf9b0f8818915ba54f3f5 (diff)
Merge tag 'v1.9.1'2.0.0-alpha.0
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions This release provides an important fix for the USB mass storage device in the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which is now require by some Operating Systems. There are also fixes for the lwIP bindings to improve non-blocking sockets and error codes. The VFS has some regressions fixed including the ability to statvfs the root. All changes are listed below. py core: - modbuiltins: add core-provided version of input() function - objstr: catch case of negative "maxsplit" arg to str.rsplit() - persistentcode: allow to compile with complex numbers disabled - objstr: allow to compile with obj-repr D, and unicode disabled - modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled - provide mp_decode_uint_skip() to help reduce stack usage - makeqstrdefs.py: make script run correctly with Python 2.6 - objstringio: if created from immutable object, follow copy on write policy extmod: - modlwip: connect: for non-blocking mode, return EINPROGRESS - modlwip: fix error codes for duplicate calls to connect() - modlwip: accept: fix error code for non-blocking mode - vfs: allow to statvfs the root directory - vfs: allow "buffering" and "encoding" args to VFS's open() - modframebuf: fix signed/unsigned comparison pendantic warning lib: - libm: use isfinite instead of finitef, for C99 compatibility - utils/interrupt_char: remove support for KBD_EXCEPTION disabled tests: - basics/string_rsplit: add tests for negative "maxsplit" argument - float: convert "sys.exit()" to "raise SystemExit" - float/builtin_float_minmax: PEP8 fixes - basics: convert "sys.exit()" to "raise SystemExit" - convert remaining "sys.exit()" to "raise SystemExit" unix port: - convert to use core-provided version of built-in import() - Makefile: replace references to make with $(MAKE) windows port: - convert to use core-provided version of built-in import() qemu-arm port: - Makefile: adjust object-file lists to get correct dependencies - enable micropython.mem_*() functions to allow more tests stmhal port: - boards: enable DAC for NUCLEO_F767ZI board - add support for NUCLEO_F446RE board - pass USB handler as parameter to allow more than one USB handler - usb: use local USB handler variable in Start-of-Frame handler - usb: make state for USB device private to top-level USB driver - usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command - convert from using stmhal's input() to core provided version cc3200 port: - convert from using stmhal's input() to core provided version teensy port: - convert from using stmhal's input() to core provided version esp8266 port: - Makefile: replace references to make with $(MAKE) - Makefile: add clean-modules target - convert from using stmhal's input() to core provided version zephyr port: - modusocket: getaddrinfo: Fix mp_obj_len() usage - define MICROPY_PY_SYS_PLATFORM (to "zephyr") - machine_pin: use native Zephyr types for Zephyr API calls docs: - machine.Pin: remove out_value() method - machine.Pin: add on() and off() methods - esp8266: consistently replace Pin.high/low methods with .on/off - esp8266/quickref: polish Pin.on()/off() examples - network: move confusingly-named cc3200 Server class to its reference - uos: deconditionalize, remove minor port-specific details - uos: move cc3200 port legacy VFS mounting functions to its ref doc - machine: sort machine classes in logical order, not alphabetically - network: first step to describe standard network class interface examples: - embedding: use core-provided KeyboardInterrupt object
Diffstat (limited to 'windows')
-rw-r--r--windows/.gitignore2
-rw-r--r--windows/Makefile2
-rw-r--r--windows/README56
-rw-r--r--windows/README.md74
-rw-r--r--windows/micropython.vcxproj8
-rw-r--r--windows/mpconfigport.h25
-rw-r--r--windows/msvc/debug.props8
-rw-r--r--windows/msvc/genhdr.targets24
-rw-r--r--windows/msvc/sources.props4
-rw-r--r--windows/windows_mphal.c8
10 files changed, 129 insertions, 82 deletions
diff --git a/windows/.gitignore b/windows/.gitignore
index d26ef4db7..12235e7c9 100644
--- a/windows/.gitignore
+++ b/windows/.gitignore
@@ -7,3 +7,5 @@
*.ilk
*.filters
/build/*
+.vs/*
+*.VC.*db
diff --git a/windows/Makefile b/windows/Makefile
index 68de66a07..72c97381b 100644
--- a/windows/Makefile
+++ b/windows/Makefile
@@ -15,7 +15,7 @@ INC += -I..
INC += -I$(BUILD)
# compiler settings
-CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -DUNIX -D__USE_MINGW_ANSI_STDIO=1 $(CFLAGS_MOD) $(COPT)
+CFLAGS = $(INC) -Wall -Wpointer-arith -Werror -std=gnu99 -DUNIX -D__USE_MINGW_ANSI_STDIO=1 $(CFLAGS_MOD) $(COPT)
LDFLAGS = $(LDFLAGS_MOD) -lm
# Debugging/Optimization
diff --git a/windows/README b/windows/README
deleted file mode 100644
index 4b383eaed..000000000
--- a/windows/README
+++ /dev/null
@@ -1,56 +0,0 @@
-This is experimental, community-supported Windows port of MicroPython.
-It is based on Unix port, and expected to remain so.
-The port requires additional testing, debugging, and patches. Please
-consider to contribute.
-
-
-To cross-compile under Debian/Ubuntu Linux system:
-
-sudo apt-get install gcc-mingw-w64
-make CROSS_COMPILE=i686-w64-mingw32-
-
-If for some reason the mingw-w64 crosscompiler is not available, you can try
-mingw32 instead, but it comes with a really old gcc which may produce some
-spurious errors (you may need to disable -Werror):
-
-sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
-make CROSS_COMPILE=i586-mingw32msvc-
-
-
-To compile under Cygwin:
-
-Install following packages using cygwin's setup.exe:
-mingw64-i686-gcc-core, mingw64-x86_64-gcc-core, make
-Build using:
-
-make CROSS_COMPILE=i686-w64-mingw32-
-
-or for 64bit:
-
-make CROSS_COMPILE=x86_64-w64-mingw32-
-
-
-To compile using Visual Studio 2013 (or higher):
-
-Open micropython.vcxproj and build
-
-
-To compile using Visual Studio 2013 (or higher) commandline:
-
-msbuild micropython.vcxproj
-
-
-To run on Linux using Wine:
-
-The default build (MICROPY_USE_READLINE=1) uses extended Windows console
-functions and thus should be run using "wineconsole" tool. Depending
-on the Wine build configuration, you may also want to select the curses
-backend which has the look&feel of a standard Unix console:
-
- wineconsole --backend=curses ./micropython.exe
-
-For more info, see https://www.winehq.org/docs/wineusr-guide/cui-programs
-
-If built without line editing and history capabilities
-(MICROPY_USE_READLINE=0), the resulting binary can be run using the standard
-"wine" tool.
diff --git a/windows/README.md b/windows/README.md
new file mode 100644
index 000000000..6d3249903
--- /dev/null
+++ b/windows/README.md
@@ -0,0 +1,74 @@
+This is the experimental, community-supported Windows port of MicroPython.
+It is based on Unix port, and expected to remain so.
+The port requires additional testing, debugging, and patches. Please
+consider to contribute.
+
+
+Building on Debian/Ubuntu Linux system
+---------------------------------------
+
+ sudo apt-get install gcc-mingw-w64
+ make CROSS_COMPILE=i686-w64-mingw32-
+
+If for some reason the mingw-w64 crosscompiler is not available, you can try
+mingw32 instead, but it comes with a really old gcc which may produce some
+spurious errors (you may need to disable -Werror):
+
+ sudo apt-get install mingw32 mingw32-binutils mingw32-runtime
+ make CROSS_COMPILE=i586-mingw32msvc-
+
+
+Building under Cygwin
+---------------------
+
+Install following packages using cygwin's setup.exe:
+
+* mingw64-i686-gcc-core
+* mingw64-x86_64-gcc-core
+* make
+
+Build using:
+
+ make CROSS_COMPILE=i686-w64-mingw32-
+
+Or for 64bit:
+
+ make CROSS_COMPILE=x86_64-w64-mingw32-
+
+
+Building using MS Visual Studio 2013 (or higher)
+------------------------------------------------
+
+In the IDE, open `micropython.vcxproj` and build.
+
+To build from the command line:
+
+ msbuild micropython.vcxproj
+
+__Stack usage__
+
+The msvc compiler is quite stack-hungry which might result in a "maximum recursion depth exceeded"
+RuntimeError for code with lots of nested function calls.
+There are several ways to deal with this:
+- increase the threshold used for detection by altering the argument to `mp_stack_set_limit` in `unix/main.c`
+- disable detection all together by setting `MICROPY_STACK_CHECK` to "0" in `windows/mpconfigport.h`
+- disable the /GL compiler flag by setting `WholeProgramOptimization` to "false"
+
+See [issue 2927](https://github.com/micropython/micropython/issues/2927) for more information.
+
+
+Running on Linux using Wine
+---------------------------
+
+The default build (MICROPY_USE_READLINE=1) uses extended Windows console
+functions and thus should be ran using the `wineconsole` tool. Depending
+on the Wine build configuration, you may also want to select the curses
+backend which has the look&feel of a standard Unix console:
+
+ wineconsole --backend=curses ./micropython.exe
+
+For more info, see https://www.winehq.org/docs/wineusr-guide/cui-programs .
+
+If built without line editing and history capabilities
+(MICROPY_USE_READLINE=0), the resulting binary can be run using the standard
+`wine` tool.
diff --git a/windows/micropython.vcxproj b/windows/micropython.vcxproj
index 6f6e11ab4..ee0b98abb 100644
--- a/windows/micropython.vcxproj
+++ b/windows/micropython.vcxproj
@@ -26,26 +26,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
- <PlatformToolset>v140</PlatformToolset>
+ <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
diff --git a/windows/mpconfigport.h b/windows/mpconfigport.h
index 6156ad39e..f2f6cbd32 100644
--- a/windows/mpconfigport.h
+++ b/windows/mpconfigport.h
@@ -32,17 +32,20 @@
#endif
#define MICROPY_ALLOC_PATH_MAX (260) //see minwindef.h for msvc or limits.h for mingw
+#define MICROPY_PERSISTENT_CODE_LOAD (1)
#define MICROPY_EMIT_X64 (0)
#define MICROPY_EMIT_THUMB (0)
#define MICROPY_EMIT_INLINE_THUMB (0)
#define MICROPY_COMP_MODULE_CONST (1)
#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (1)
+#define MICROPY_COMP_RETURN_IF_EXPR (1)
#define MICROPY_ENABLE_GC (1)
#define MICROPY_ENABLE_FINALISER (1)
#define MICROPY_STACK_CHECK (1)
#define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
#define MICROPY_MEM_STATS (1)
#define MICROPY_DEBUG_PRINTERS (1)
+#define MICROPY_DEBUG_PRINTER_DEST mp_stderr_print
#define MICROPY_READER_POSIX (1)
#define MICROPY_USE_READLINE_HISTORY (1)
#define MICROPY_HELPER_REPL (1)
@@ -59,11 +62,15 @@
#define MICROPY_PY_FUNCTION_ATTRS (1)
#define MICROPY_PY_DESCRIPTORS (1)
#define MICROPY_PY_BUILTINS_STR_UNICODE (1)
+#define MICROPY_PY_BUILTINS_STR_CENTER (1)
+#define MICROPY_PY_BUILTINS_STR_PARTITION (1)
#define MICROPY_PY_BUILTINS_STR_SPLITLINES (1)
#define MICROPY_PY_BUILTINS_MEMORYVIEW (1)
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_BUILTINS_COMPILE (1)
#define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1)
+#define MICROPY_PY_BUILTINS_INPUT (1)
+#define MICROPY_PY_BUILTINS_POW3 (1)
#define MICROPY_PY_MICROPYTHON_MEM_INFO (1)
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
#define MICROPY_PY_ARRAY_SLICE_ASSIGN (1)
@@ -83,27 +90,35 @@
#define MICROPY_STACKLESS (0)
#define MICROPY_STACKLESS_STRICT (0)
+#define MICROPY_PY_UTIME (1)
+#define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_UERRNO (1)
#define MICROPY_PY_UCTYPES (1)
#define MICROPY_PY_UZLIB (1)
#define MICROPY_PY_UJSON (1)
#define MICROPY_PY_URE (1)
#define MICROPY_PY_UHEAPQ (1)
+#define MICROPY_PY_UTIMEQ (1)
#define MICROPY_PY_UHASHLIB (1)
#define MICROPY_PY_UBINASCII (1)
+#define MICROPY_PY_UBINASCII_CRC32 (1)
#define MICROPY_PY_URANDOM (1)
-#define MICROPY_PY_UTIME (1)
-#define MICROPY_PY_UTIME_MP_HAL (1)
#define MICROPY_PY_MACHINE (1)
+#define MICROPY_PY_MACHINE_PULSE (1)
+#define MICROPY_MACHINE_MEM_GET_READ_ADDR mod_machine_mem_get_addr
+#define MICROPY_MACHINE_MEM_GET_WRITE_ADDR mod_machine_mem_get_addr
#define MICROPY_ERROR_REPORTING (MICROPY_ERROR_REPORTING_DETAILED)
#define MICROPY_WARNINGS (1)
+#define MICROPY_PY_STR_BYTES_CMP_WARN (1)
+
#ifdef _MSC_VER
#define MICROPY_GCREGS_SETJMP (1)
#endif
#define MICROPY_ENABLE_EMERGENCY_EXCEPTION_BUF (1)
#define MICROPY_EMERGENCY_EXCEPTION_BUF_SIZE (256)
+#define MICROPY_KBD_EXCEPTION (1)
#define MICROPY_PORT_INIT_FUNC init()
#define MICROPY_PORT_DEINIT_FUNC deinit()
@@ -128,8 +143,6 @@ typedef int mp_int_t; // must be pointer size
typedef unsigned int mp_uint_t; // must be pointer size
#endif
-#define BYTES_PER_WORD sizeof(mp_int_t)
-
// Just assume Windows is little-endian - mingw32 gcc doesn't
// define standard endianness macros.
#define MP_ENDIANNESS_LITTLE (1)
@@ -151,7 +164,6 @@ void mp_hal_dupterm_tx_strn(const char *str, size_t len);
#endif
#define MICROPY_PORT_BUILTINS \
- { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj },
extern const struct _mp_obj_module_t mp_module_os;
@@ -163,8 +175,7 @@ extern const struct _mp_obj_module_t mp_module_time;
#if MICROPY_USE_READLINE == 1
#define MICROPY_PORT_ROOT_POINTERS \
- char *readline_hist[50]; \
- mp_obj_t keyboard_interrupt_obj;
+ char *readline_hist[50];
#endif
#define MP_STATE_PORT MP_STATE_VM
diff --git a/windows/msvc/debug.props b/windows/msvc/debug.props
index c0a22be85..fa1ca4fcb 100644
--- a/windows/msvc/debug.props
+++ b/windows/msvc/debug.props
@@ -4,10 +4,6 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
</PropertyGroup>
- <ItemDefinitionGroup>
- <ClCompile>
- <PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- </ItemDefinitionGroup>
+ <ItemDefinitionGroup />
<ItemGroup />
-</Project>
+</Project> \ No newline at end of file
diff --git a/windows/msvc/genhdr.targets b/windows/msvc/genhdr.targets
index 8c2ba8eb2..cac3e3ddc 100644
--- a/windows/msvc/genhdr.targets
+++ b/windows/msvc/genhdr.targets
@@ -43,8 +43,13 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
</Task>
</UsingTask>
+ <!-- If any of these changed we'll force all qstrs to be generated again-->
+ <ItemGroup>
+ <QstrDependencies Include="$(PyWinDir)mpconfigport.h;$(PySrcDir)mpconfig.h;$(PySrcDir)makeqstrdata.py"/>
+ </ItemGroup>
+
<!-- Preprocess changed files, concatenate and feed into makeqstrdefs.py split/cat-->
- <Target Name="MakeQstrDefs" DependsOnTargets="MakeDestDir" Inputs="@(ClCompile)" Outputs="$(QstrDefsCollected)">
+ <Target Name="MakeQstrDefs" DependsOnTargets="MakeDestDir" Inputs="@(ClCompile);@(QstrDependencies)" Outputs="$(QstrDefsCollected)">
<ItemGroup>
<PyIncDirs Include="$(PyIncDirs)"/>
<PreProcDefs Include="%(ClCompile.PreProcessorDefinitions);NO_QSTR;N_X64;N_X86;N_THUMB;N_ARM"/>
@@ -56,15 +61,22 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
<OutDir>$([System.IO.Path]::GetDirectoryName('%(OutFile)'))</OutDir>
</PyQstrSourceFiles>
<PyQstrSourceFiles>
- <Changed>$([System.DateTime]::Compare($([System.IO.File]::GetLastWriteTime('%(FullPath)')), $([System.IO.File]::GetLastWriteTime('%(OutFile)'))))</Changed>
+ <Changed Condition="$([System.DateTime]::Compare($([System.IO.File]::GetLastWriteTime('%(FullPath)')), $([System.IO.File]::GetLastWriteTime('%(OutFile)')))) &gt; 0">True</Changed>
</PyQstrSourceFiles>
+ <QstrDependencies>
+ <Changed Condition="$([System.DateTime]::Compare($([System.IO.File]::GetLastWriteTime('%(FullPath)')), $([System.IO.File]::GetLastWriteTime('$(DestDir)qstr.i.last')))) &gt; 0">True</Changed>
+ </QstrDependencies>
</ItemGroup>
+ <PropertyGroup>
+ <ForceQstrRebuild>@(QstrDependencies->AnyHaveMetadataValue('Changed', 'True'))</ForceQstrRebuild>
+ <RunPreProcConcat>@(PyQstrSourceFiles->AnyHaveMetadataValue('Changed', 'True'))</RunPreProcConcat>
+ </PropertyGroup>
<MakeDir Directories="@(PyQstrSourceFiles->'%(OutDir)')"/>
<Exec Command="cl /nologo /I@(PyIncDirs, ' /I') /D@(PreProcDefs, ' /D') /Fi%(PyQstrSourceFiles.OutFile) /P %(PyQstrSourceFiles.Identity)"
- Condition="%(PyQstrSourceFiles.Changed) &gt; 0"/>
+ Condition="'%(PyQstrSourceFiles.Changed)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"/>
<ConcatPreProcFiles InputFiles="@(PyQstrSourceFiles->'%(OutFile)')" OutputFile="$(DestDir)qstr.i.last"
- Condition="%(PyQstrSourceFiles.Changed) &gt; 0"/>
+ Condition="'$(RunPreProcConcat)' == 'True' Or '$(ForceQstrRebuild)' == 'True'"/>
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdefs.py split $(DestDir)qstr.i.last $(DestDir)qstr $(QstrDefsCollected)"/>
<Exec Command="$(PyPython) $(PySrcDir)makeqstrdefs.py cat $(DestDir)qstr.i.last $(DestDir)qstr $(QstrDefsCollected)"/>
</Target>
@@ -87,6 +99,10 @@ using(var outFile = System.IO.File.CreateText(OutputFile)) {
<MSBuild Projects="$(MSBuildThisFileFullPath)" Targets="CopyFileIfDifferent" Properties="SourceFile=$(TmpFile);DestFile=$(DestFile)"/>
</Target>
+ <Target Name="RemoveGeneratedFiles" AfterTargets="Clean">
+ <RemoveDir Directories="$(DestDir)"/>
+ </Target>
+
<!--Copies SourceFile to DestFile only if SourceFile's content differs from DestFile's.
We use this to 'touch' the generated files only when they are really newer
so a build is only triggered if the generated content actually changed,
diff --git a/windows/msvc/sources.props b/windows/msvc/sources.props
index 4ea917552..a97686cdc 100644
--- a/windows/msvc/sources.props
+++ b/windows/msvc/sources.props
@@ -15,6 +15,8 @@
<ClCompile Include="$(PyBaseDir)unix\modmachine.c" />
<ClCompile Include="$(PyBaseDir)extmod\machine_mem.c" />
<ClCompile Include="$(PyBaseDir)extmod\machine_pinbase.c" />
+ <ClCompile Include="$(PyBaseDir)extmod\machine_pulse.c" />
+ <ClCompile Include="$(PyBaseDir)extmod\machine_signal.c" />
<ClCompile Include="$(PyBaseDir)extmod\modubinascii.c" />
<ClCompile Include="$(PyBaseDir)extmod\moductypes.c" />
<ClCompile Include="$(PyBaseDir)extmod\moduhashlib.c" />
@@ -22,8 +24,10 @@
<ClCompile Include="$(PyBaseDir)extmod\modujson.c" />
<ClCompile Include="$(PyBaseDir)extmod\modurandom.c" />
<ClCompile Include="$(PyBaseDir)extmod\modure.c" />
+ <ClCompile Include="$(PyBaseDir)extmod\modutimeq.c" />
<ClCompile Include="$(PyBaseDir)extmod\moduzlib.c" />
<ClCompile Include="$(PyBaseDir)extmod\utime_mphal.c" />
+ <ClCompile Include="$(PyBaseDir)extmod\virtpin.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(PyBaseDir)py\*.h" />
diff --git a/windows/windows_mphal.c b/windows/windows_mphal.c
index 3ad693905..a73140e54 100644
--- a/windows/windows_mphal.c
+++ b/windows/windows_mphal.c
@@ -72,19 +72,19 @@ void mp_hal_stdio_mode_orig(void) {
// Previous versions of the mp_hal code would install a handler whenever Ctrl-C input is
// allowed and remove the handler again when it is not. That is not necessary though (1),
// and it might introduce problems (2) because console notifications are delivered to the
-// application in a seperate thread.
+// application in a separate thread.
// (1) mp_hal_set_interrupt_char effectively enables/disables processing of Ctrl-C via the
// ENABLE_PROCESSED_INPUT flag so in raw mode console_sighandler won't be called.
// (2) if mp_hal_set_interrupt_char would remove the handler while Ctrl-C was issued earlier,
// the thread created for handling it might not be running yet so we'd miss the notification.
BOOL WINAPI console_sighandler(DWORD evt) {
if (evt == CTRL_C_EVENT) {
- if (MP_STATE_VM(mp_pending_exception) == MP_STATE_VM(keyboard_interrupt_obj)) {
+ if (MP_STATE_VM(mp_pending_exception) == MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception))) {
// this is the second time we are called, so die straight away
exit(1);
}
- mp_obj_exception_clear_traceback(MP_STATE_VM(keyboard_interrupt_obj));
- MP_STATE_VM(mp_pending_exception) = MP_STATE_VM(keyboard_interrupt_obj);
+ mp_obj_exception_clear_traceback(MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception)));
+ MP_STATE_VM(mp_pending_exception) = MP_OBJ_FROM_PTR(&MP_STATE_VM(mp_kbd_exception));
return TRUE;
}
return FALSE;