diff --git a/CMake/Modules/FindSystem.IO.FileSystem.cmake b/CMake/Modules/FindSystem.IO.FileSystem.cmake index 166ca93bfe..21ba465382 100644 --- a/CMake/Modules/FindSystem.IO.FileSystem.cmake +++ b/CMake/Modules/FindSystem.IO.FileSystem.cmake @@ -22,7 +22,7 @@ set(System.IO.FileSystem_SRCS nf_sys_io_filesystem.cpp - nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard__.cpp + nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard_stubs.cpp nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard.cpp nf_sys_io_filesystem_System_IO_Directory.cpp nf_sys_io_filesystem_System_IO_DriveInfo.cpp diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard__.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard__.cpp deleted file mode 100644 index 9878b5cf78..0000000000 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard__.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// -// Copyright (c) .NET Foundation and Contributors -// See LICENSE file in the project root for full license information. -// - -#include "nf_sys_io_filesystem.h" - -__nfweak HRESULT - Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::InitNative___VOID(CLR_RT_StackFrame &stack) -{ - NANOCLR_HEADER(); - - NANOCLR_SET_AND_LEAVE(stack.NotImplementedStub()); - - NANOCLR_NOCLEANUP(); -} - -__nfweak HRESULT - Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::MountNative___VOID(CLR_RT_StackFrame &stack) -{ - NANOCLR_HEADER(); - - NANOCLR_SET_AND_LEAVE(stack.NotImplementedStub()); - - NANOCLR_NOCLEANUP(); -} - -__nfweak HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::UnmountNative___VOID( - CLR_RT_StackFrame &stack) -{ - NANOCLR_HEADER(); - - NANOCLR_SET_AND_LEAVE(stack.NotImplementedStub()); - - NANOCLR_NOCLEANUP(); -} - -__nfweak HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::PollCardDetectNative___BOOLEAN( - CLR_RT_StackFrame &stack) -{ - NANOCLR_HEADER(); - - NANOCLR_SET_AND_LEAVE(stack.NotImplementedStub()); - - NANOCLR_NOCLEANUP(); -} - -__nfweak HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::NativeDispose___VOID( - CLR_RT_StackFrame &stack) -{ - NANOCLR_HEADER(); - - NANOCLR_SET_AND_LEAVE(stack.NotImplementedStub()); - - NANOCLR_NOCLEANUP(); -} diff --git a/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard_stubs.cpp b/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard_stubs.cpp index 8da149bb47..e05839dce7 100644 --- a/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard_stubs.cpp +++ b/src/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard_stubs.cpp @@ -5,7 +5,8 @@ #include "nf_sys_io_filesystem.h" -HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::InitNative___VOID( CLR_RT_StackFrame &stack ) +__nfweak HRESULT + Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::InitNative___VOID(CLR_RT_StackFrame &stack) { NANOCLR_HEADER(); @@ -14,7 +15,8 @@ HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard:: NANOCLR_NOCLEANUP(); } -HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::NativeDispose___VOID( CLR_RT_StackFrame &stack ) +__nfweak HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::NativeDispose___VOID( + CLR_RT_StackFrame &stack) { NANOCLR_HEADER(); @@ -23,7 +25,8 @@ HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard:: NANOCLR_NOCLEANUP(); } -HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::MountNative___VOID( CLR_RT_StackFrame &stack ) +__nfweak HRESULT + Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::MountNative___VOID(CLR_RT_StackFrame &stack) { NANOCLR_HEADER(); @@ -32,7 +35,8 @@ HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard:: NANOCLR_NOCLEANUP(); } -HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::UnmountNative___VOID( CLR_RT_StackFrame &stack ) +__nfweak HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::UnmountNative___VOID( + CLR_RT_StackFrame &stack) { NANOCLR_HEADER(); @@ -41,7 +45,8 @@ HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard:: NANOCLR_NOCLEANUP(); } -HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::PollCardDetectNative___BOOLEAN( CLR_RT_StackFrame &stack ) +__nfweak HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::PollCardDetectNative___BOOLEAN( + CLR_RT_StackFrame &stack) { NANOCLR_HEADER(); diff --git a/targets/ChibiOS/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard.cpp b/targets/ChibiOS/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard.cpp index 45d7259fad..eb95f83a24 100644 --- a/targets/ChibiOS/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard.cpp +++ b/targets/ChibiOS/_nanoCLR/System.IO.FileSystem/nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard.cpp @@ -16,65 +16,6 @@ void postManagedStorageEvent(bool pinState, uint32_t driveIndex) PostManagedEvent(EVENT_STORAGE, 0, GetStorageEventType(pinState), driveIndex); } -// void cardDetect_interrupt(GPIO_PIN Pin, bool pinState, void *pArg) -// { -// (void)Pin; - -// postManagedStorageEvent(pinState, (uint32_t)pArg); -// } - -// // Reserve all MMC pins -// // CMD, Data0, Data1, Data2, Data3 -// int8_t pins4bit[] = {15, 2, 4, 12, 13}; -// // CMD, Data0 -// int8_t pins1bit[] = {15, 2}; - -// void GetMMCPins(bool _1bit, int *count, int8_t **pPins) -// { -// if (_1bit) -// { -// *pPins = pins1bit; -// *count = sizeof(pins1bit); -// } -// else -// { -// *pPins = pins4bit; -// *count = sizeof(pins4bit); -// } -// } - -// void UnReservePins(int count, int8_t *pPins) -// { -// for (int index = count - 1; index >= 0; index--) -// { -// CPU_GPIO_ReservePin((GPIO_PIN)pPins[index], false); -// } -// } - -// bool TryReservePins(int count, int8_t *pPins) -// { -// int index = 0; -// bool failed = false; - -// for (index = 0; index < count; index++) -// { -// if (CPU_GPIO_ReservePin((int8_t)pPins[index], true) == false) -// { -// failed = true; -// break; -// } -// } - -// // If we failed then UnReserve pins already reserved -// if (failed) -// { -// UnReservePins(index - 1, pPins); -// return false; -// } - -// return true; -// } - HRESULT Library_nf_sys_io_filesystem_nanoFramework_System_IO_FileSystem_SDCard::InitNative___VOID( CLR_RT_StackFrame &stack) {