From e9288abe7f0c52bf407cb258d4e936d06a9b9557 Mon Sep 17 00:00:00 2001 From: enriquezgarc Date: Mon, 7 Aug 2023 13:29:53 +0200 Subject: [PATCH] ports/psoc6: Removed examples and tests folder.Unused and deprecated. Signed-off-by: enriquezgarc --- ports/psoc6/examples/machine/machine.py | 0 ports/psoc6/tests/network.py | 52 ------------------------- ports/psoc6/tests/network_wlan.py | 21 ---------- ports/psoc6/tests/vfs_fat.py | 27 ------------- ports/psoc6/tests/vfs_lfs2.py | 29 -------------- ports/psoc6/tests/vfs_ramdisk.py | 34 ---------------- 6 files changed, 163 deletions(-) delete mode 100644 ports/psoc6/examples/machine/machine.py delete mode 100644 ports/psoc6/tests/network.py delete mode 100644 ports/psoc6/tests/network_wlan.py delete mode 100644 ports/psoc6/tests/vfs_fat.py delete mode 100644 ports/psoc6/tests/vfs_lfs2.py delete mode 100644 ports/psoc6/tests/vfs_ramdisk.py diff --git a/ports/psoc6/examples/machine/machine.py b/ports/psoc6/examples/machine/machine.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/ports/psoc6/tests/network.py b/ports/psoc6/tests/network.py deleted file mode 100644 index 0df5f1c5b3be9..0000000000000 --- a/ports/psoc6/tests/network.py +++ /dev/null @@ -1,52 +0,0 @@ -import machine, network - -print("Testing Network") - -import network - -sta_if = network.WLAN(network.STA_IF) -sta_if.config(trace=1) - -print("deactivating network") -sta_if.active(False) # disable wifi if currently active - in case of issues from a previous run -# sta_if.deinit() -# pyb.delay(5000) - -print("setting active") -sta_if.active(True) -# pyb.delay(5000) - - -print("setting antenna") -sta_if.config(antenna=0) # select antenna, 0=chip, 1=external -# pyb.delay(5000) - -print("connecting") -sta_if.connect("ssid", "password") -# pyb.delay(5000) - -print("checking if is connected") -while not sta_if.isconnected(): - pyb.delay(5000) - - # Check the status - print("getting status") - status = sta_if.status() - - if status <= 0: - # Error States? - return False - - print("checking if is connected") - - -import machine, network - -sta_if = network.WLAN(network.STA_IF) -count = 0 - -if not sta_if.isconnected(): - print("connecting to hotspot...") - # sta_if.active(True) - sta_if.ifconfig(("192.168.10.99", "255.255.255.0", "192.168.10.1", "8.8.8.8")) - sta_if.connect("HUAWEI-E8231-c4fd", "my_password") diff --git a/ports/psoc6/tests/network_wlan.py b/ports/psoc6/tests/network_wlan.py deleted file mode 100644 index f7d721f3b3064..0000000000000 --- a/ports/psoc6/tests/network_wlan.py +++ /dev/null @@ -1,21 +0,0 @@ -import network - -print("Testing PSoC6 Network module") - -sta_if = network.WLAN(network.STA_IF) - -ssid = "OnePlus 9 5G" -password = "psoc-mpy" -ifconfig_params = ("192.168.255.75", "255.255.255.0", "192.168.255.73", "192.168.255.73") - -if not sta_if.isconnected(): - print("Status: ", isconnected()) - print("Connecting to hotspot...") - sta_if.ifconfig(ifconfig_params) - sta_if.connect(ssid, password) - if sta_if.ifconfig() == ifconfig_params: - print("ifconfig params match") - if sta_if.active() == 1: - print("Successfully connected") - -sta_if.disconnect() diff --git a/ports/psoc6/tests/vfs_fat.py b/ports/psoc6/tests/vfs_fat.py deleted file mode 100644 index 07883d89667a0..0000000000000 --- a/ports/psoc6/tests/vfs_fat.py +++ /dev/null @@ -1,27 +0,0 @@ -import os -import machine, psoc6 - - -# Try to mount the filesystem, and format the flash if it doesn't exist. -bdev = psoc6.Flash() -os.umount("/flash") - -os.VfsLfs2.mkfs(bdev) -vfs = os.VfsLfs2(bdev) -os.mount(vfs, "/flash") - - -f = open("/flash/hello.txt", "w") - -f.write( - "abcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb") -# f.write('bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb') -# f.write('bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb') - -f.close() - -f = open("/flash/hello.txt", "r") -print(f.read()) -f.close() diff --git a/ports/psoc6/tests/vfs_lfs2.py b/ports/psoc6/tests/vfs_lfs2.py deleted file mode 100644 index 21ab0c1417a47..0000000000000 --- a/ports/psoc6/tests/vfs_lfs2.py +++ /dev/null @@ -1,29 +0,0 @@ -import os -import machine, psoc6 - - -# Try to mount the filesystem, and format the flash if it doesn't exist. -# Note: the flash requires the programming size to be aligned to 256 bytes. -bdev = psoc6.Flash() -os.umount("/flash") - -block_size = 0x200 -os.VfsLfs2.mkfs(bdev, progsize=block_size, readsize=block_size) -vfs = os.VfsLfs2(bdev, progsize=block_size, readsize=block_size) -os.mount(vfs, "/flash") - - -f = open("/flash/hello.txt", "w") - -f.write( - "abcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb') -# f.write('bAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAb') - -f.close() - -f = open("/flash/hello.txt", "r") -print(f.read()) -f.close() diff --git a/ports/psoc6/tests/vfs_ramdisk.py b/ports/psoc6/tests/vfs_ramdisk.py deleted file mode 100644 index 07d72c9588bda..0000000000000 --- a/ports/psoc6/tests/vfs_ramdisk.py +++ /dev/null @@ -1,34 +0,0 @@ -class RAMBlockDev: - def __init__(self, block_size, num_blocks): - self.block_size = block_size - self.data = bytearray(block_size * num_blocks) - - def readblocks(self, block_num, buf): - for i in range(len(buf)): - buf[i] = self.data[block_num * self.block_size + i] - - def writeblocks(self, block_num, buf): - for i in range(len(buf)): - self.data[block_num * self.block_size + i] = buf[i] - - def ioctl(self, op, arg): - if op == 4: # get number of blocks - return len(self.data) // self.block_size - if op == 5: # get block size - return self.block_size - - -import os - - -print(os.getcwd()) -print(os.listdir()) - - -bdev = RAMBlockDev(512, 50) -os.VfsFat.mkfs(bdev) -os.mount(bdev, "/ramdisk") - -print(os.getcwd()) -print(os.listdir()) -print(os.listdir("/ramdisk"))