mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2033 from openmv/remove_self_test
ports/all: Remove support for self-tests.
This commit is contained in:
commit
fad81c1b9a
@ -76,9 +76,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (320 * 240 * 2)
|
||||
@ -90,9 +87,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 256
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.0"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
#define OMV_USB_ULPI (0)
|
||||
|
||||
@ -67,9 +67,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique address.
|
||||
#define OMV_ENABLE_TUSBDBG (1)
|
||||
#define OMV_TUSBDBG_PACKET (64)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (160 * 120)
|
||||
@ -81,9 +78,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique address.
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (USBCTRL_IRQ_IRQn)
|
||||
#define OMV_USB1_IRQ_HANDLER (USBD_IRQHandler)
|
||||
|
||||
@ -71,9 +71,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (320 * 240 * 2)
|
||||
@ -85,9 +82,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.0"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_HS_IRQn)
|
||||
#define OMV_USB_ULPI (1)
|
||||
|
||||
@ -85,9 +85,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (320 * 240 * 2)
|
||||
@ -99,9 +96,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 256
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.0"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_HS_IRQn)
|
||||
#define OMV_USB_ULPI (1)
|
||||
|
||||
@ -23,9 +23,6 @@
|
||||
#define OMV_MAX_BLOB_FRAME FRAMESIZE_QCIF
|
||||
#define OMV_MAX_BLOB_FRAME_STR "QCIF"
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -57,9 +54,6 @@
|
||||
// Enable sensor features
|
||||
#define OMV_ENABLE_OV5640_AF (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (1)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (160 * 120 * 2)
|
||||
@ -71,9 +65,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -57,9 +54,6 @@
|
||||
// Enable sensor features
|
||||
#define OMV_ENABLE_OV5640_AF (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (1)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (160 * 120 * 2)
|
||||
@ -71,9 +65,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -85,9 +82,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (1)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (1)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (320 * 240 * 2)
|
||||
@ -99,9 +93,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer overlay stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR *((uint32_t *) 0x24000018)
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -84,9 +81,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (1)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (1)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (1920 * 1080 * 2)
|
||||
@ -98,9 +92,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 256
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 4 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer overlay stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR *((uint32_t *) 0x24000018)
|
||||
|
||||
#define OMV_XCLK_MCO (0U)
|
||||
#define OMV_XCLK_TIM (1U)
|
||||
|
||||
@ -85,9 +82,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (1920 * 1080 * 2)
|
||||
@ -99,9 +93,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 256
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_HS_IRQn)
|
||||
#define OMV_USB_ULPI (1)
|
||||
|
||||
@ -83,9 +83,6 @@
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (1)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (1920 * 1080 * 2)
|
||||
@ -97,9 +94,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 256
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (OTG_FS_IRQn)
|
||||
|
||||
|
||||
@ -18,9 +18,6 @@
|
||||
#define OMV_UNIQUE_ID_SIZE 3 // Unique ID size in words.
|
||||
#define OMV_UNIQUE_ID_OFFSET 12 // Bytes offset for multi-word UIDs.
|
||||
|
||||
// Needed by the SWD JTAG testrig - located at the bottom of the frame buffer stack.
|
||||
#define OMV_SELF_TEST_SWD_ADDR MAIN_FB()->pixfmt
|
||||
|
||||
// Sensor external clock timer frequency.
|
||||
#define OMV_XCLK_FREQUENCY (12000000)
|
||||
|
||||
@ -69,9 +66,6 @@
|
||||
#define OMV_ENABLE_TUSBDBG (1)
|
||||
#define OMV_TUSBDBG_PACKET (512)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (320 * 240 * 2)
|
||||
@ -83,9 +77,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB config.
|
||||
#define OMV_USB_IRQN (USB_OTG1_IRQn)
|
||||
#define OMV_USB1_IRQ_HANDLER (USB_OTG1_IRQHandler)
|
||||
|
||||
@ -64,9 +64,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique ID address.
|
||||
// Enable WiFi debug
|
||||
#define OMV_ENABLE_WIFIDBG (0)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (160 * 120)
|
||||
@ -78,9 +75,6 @@ extern unsigned char *OMV_UNIQUE_ID_ADDR; // Unique ID address.
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (USBCTRL_IRQ_IRQn)
|
||||
#define OMV_USB1_IRQ_HANDLER (USBD_IRQHandler)
|
||||
|
||||
@ -65,9 +65,6 @@
|
||||
#define OMV_ENABLE_TUSBDBG (1)
|
||||
#define OMV_TUSBDBG_PACKET (64)
|
||||
|
||||
// Enable self-tests on first boot
|
||||
#define OMV_ENABLE_SELFTEST (0)
|
||||
|
||||
// If buffer size is bigger than this threshold, the quality is reduced.
|
||||
// This is only used for JPEG images sent to the IDE not normal compression.
|
||||
#define JPEG_QUALITY_THRESH (320 * 240)
|
||||
@ -79,9 +76,6 @@
|
||||
// FB Heap Block Size
|
||||
#define OMV_UMM_BLOCK_SIZE 16
|
||||
|
||||
// Core VBAT for selftests
|
||||
#define OMV_CORE_VBAT "3.3"
|
||||
|
||||
// USB IRQn.
|
||||
#define OMV_USB_IRQN (USBD_IRQn)
|
||||
#define OMV_USB1_IRQ_HANDLER (USBD_IRQHandler)
|
||||
|
||||
@ -1,74 +0,0 @@
|
||||
static const char fresh_selftest_py[] =
|
||||
"import sensor, time, pyb\n"
|
||||
"\n"
|
||||
"def test_int_adc():\n"
|
||||
" adc = pyb.ADCAll(12)\n"
|
||||
" # Test VBAT\n"
|
||||
" vbat = adc.read_core_vbat()\n"
|
||||
" vbat_diff = abs(vbat-"OMV_CORE_VBAT")\n"
|
||||
" if (vbat_diff > 0.15):\n"
|
||||
" raise Exception('INTERNAL ADC TEST FAILED VBAT=%fv'%vbat)\n"
|
||||
"\n"
|
||||
" # Test VREF\n"
|
||||
" vref = adc.read_core_vref()\n"
|
||||
" vref_diff = abs(vref-1.2)\n"
|
||||
" if (vref_diff > 0.1):\n"
|
||||
" raise Exception('INTERNAL ADC TEST FAILED VREF=%fv'%vref)\n"
|
||||
" adc = None\n"
|
||||
" print('INTERNAL ADC TEST PASSED...')\n"
|
||||
"\n"
|
||||
"def test_color_bars():\n"
|
||||
" sensor.reset()\n"
|
||||
" # Set sensor settings\n"
|
||||
" sensor.set_brightness(0)\n"
|
||||
" sensor.set_saturation(3)\n"
|
||||
" sensor.set_gainceiling(8)\n"
|
||||
" sensor.set_contrast(2)\n"
|
||||
"\n"
|
||||
" # Set sensor pixel format\n"
|
||||
" sensor.set_framesize(sensor.QVGA)\n"
|
||||
" sensor.set_pixformat(sensor.RGB565)\n"
|
||||
"\n"
|
||||
" # Enable colorbar test mode\n"
|
||||
" sensor.set_colorbar(True)\n"
|
||||
"\n"
|
||||
" # Skip a few frames to allow the sensor settle down\n"
|
||||
" for i in range(0, 100):\n"
|
||||
" image = sensor.snapshot()\n"
|
||||
"\n"
|
||||
" #color bars thresholds\n"
|
||||
" t = [lambda r, g, b: r < 70 and g < 70 and b < 70, # Black\n"
|
||||
" lambda r, g, b: r < 70 and g < 70 and b > 200, # Blue\n"
|
||||
" lambda r, g, b: r > 200 and g < 70 and b < 70, # Red\n"
|
||||
" lambda r, g, b: r > 200 and g < 70 and b > 200, # Purple\n"
|
||||
" lambda r, g, b: r < 70 and g > 200 and b < 70, # Green\n"
|
||||
" lambda r, g, b: r < 70 and g > 200 and b > 200, # Aqua\n"
|
||||
" lambda r, g, b: r > 200 and g > 200 and b < 70, # Yellow\n"
|
||||
" lambda r, g, b: r > 200 and g > 200 and b > 200] # White\n"
|
||||
"\n"
|
||||
" # color bars are inverted for OV7725\n"
|
||||
" if (sensor.get_id() == sensor.OV7725):\n"
|
||||
" t = t[::-1]\n"
|
||||
"\n"
|
||||
" #320x240 image with 8 color bars each one is approx 40 pixels.\n"
|
||||
" #we start from the center of the frame buffer, and average the\n"
|
||||
" #values of 10 sample pixels from the center of each color bar.\n"
|
||||
" for i in range(0, 8):\n"
|
||||
" avg = (0, 0, 0)\n"
|
||||
" idx = 40*i+20 #center of colorbars\n"
|
||||
" for off in range(0, 10): #avg 10 pixels\n"
|
||||
" rgb = image.get_pixel(idx+off, 120)\n"
|
||||
" avg = tuple(map(sum, zip(avg, rgb)))\n"
|
||||
"\n"
|
||||
" if not t[i](avg[0]/10, avg[1]/10, avg[2]/10):\n"
|
||||
" raise Exception('COLOR BARS TEST FAILED.'\n"
|
||||
" 'BAR#(%d): RGB(%d,%d,%d)'%(i+1, avg[0]/10, avg[1]/10, avg[2]/10))\n"
|
||||
"\n"
|
||||
" print('COLOR BARS TEST PASSED...')\n"
|
||||
"\n"
|
||||
"if __name__ == '__main__':\n"
|
||||
" print('')\n"
|
||||
" test_int_adc()\n"
|
||||
" if sensor.get_id() == sensor.OV7725: test_color_bars()\n"
|
||||
"\n"
|
||||
;
|
||||
Loading…
Reference in New Issue
Block a user