From 28f2b840e30433c30534dbf5f39294ee9c0e4765 Mon Sep 17 00:00:00 2001 From: EricB-ADI Date: Wed, 21 Aug 2024 15:48:49 -0500 Subject: [PATCH] Revert "fix(Examples): Updated CAM02 examples (#963)" This reverts commit 0038d43afc1f6159f90b2b4823ad07d0400195c3. --- .../MAX78000/CNN/cats-dogs_demo/README.md | 6 ++--- Examples/MAX78000/CNN/cats-dogs_demo/main.c | 22 ++++++++----------- .../MAX78000/CNN/cats-dogs_demo/project.mk | 21 +++++++----------- Examples/MAX78000/ImgCapture/project.mk | 6 ----- 4 files changed, 20 insertions(+), 35 deletions(-) diff --git a/Examples/MAX78000/CNN/cats-dogs_demo/README.md b/Examples/MAX78000/CNN/cats-dogs_demo/README.md index ec48d18f844..53f90da75e9 100644 --- a/Examples/MAX78000/CNN/cats-dogs_demo/README.md +++ b/Examples/MAX78000/CNN/cats-dogs_demo/README.md @@ -5,7 +5,7 @@ Description ----------- -The model trained in this demo is used to classify images of cats and dogs. 25000 images dataset is used to train the model. The dataset can be downloaded using�[https://www.kaggle.com/c/dogs-vs-cats/data](https://www.kaggle.com/c/dogs-vs-cats/data)�link. The input size is 128x128 pixels RGB which is 3x128x128 in CHW format. +The model trained in this demo is used to classify images of cats and dogs. 25000 images dataset is used to train the model. The dataset can be downloaded using�[https://www.kaggle.com/c/dogs-vs-cats/data](https://www.kaggle.com/c/dogs-vs-cats/data)�link. The input size is 64x64 pixels RGB which is 3x64x64 in CHW format. The code uses a sampledata header (sampledata.h) file to test a pre-defined input sample. The example also supports live capture from camera module and displays the image on the TFT LCD. @@ -75,13 +75,13 @@ The PB1 (SW1) button is located as shown in picture bellow: ### Camera Mode -This mode uses OVM7692 camera module to capture an image in RGB888 format. Since the model is trained using 128x128 pixel image, the PCIF peripheral captures 128x128 pixel image and displays it on LCD. +This mode uses OVM7692 camera module to capture an image in RGB888 format. Since the model is trained using 64x64 pixel image, the PCIF peripheral captures 64x64 pixel image and displays it on LCD. ### Offline Mode To operate in this mode, uncomment "#define USE\_SAMPLEDATA", defined in main.c.� -This mode uses a header file "sampledata.h" containing RGB image data and it should be included in the project to use it as an input to the CNN network.� +This mode uses a header file "sampledata.h" containing RGB image data and it should be included in the project to use it as an input to the cnn network.� To create your own header file follow these steps: diff --git a/Examples/MAX78000/CNN/cats-dogs_demo/main.c b/Examples/MAX78000/CNN/cats-dogs_demo/main.c index c9145687a93..5be310eb8f5 100644 --- a/Examples/MAX78000/CNN/cats-dogs_demo/main.c +++ b/Examples/MAX78000/CNN/cats-dogs_demo/main.c @@ -151,7 +151,9 @@ static uint8_t *rx_data = NULL; void setup_dma_tft(uint32_t *src_ptr, uint16_t byte_cnt) { // TFT DMA - while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {} + while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) { + ; + } MXC_DMA->ch[g_dma_channel_tft].status = MXC_F_DMA_STATUS_CTZ_IF; // Clear CTZ status flag MXC_DMA->ch[g_dma_channel_tft].dst = (uint32_t)rx_data; // Cast Pointer @@ -184,7 +186,9 @@ void setup_dma_tft(uint32_t *src_ptr, uint16_t byte_cnt) /* **************************************************************************** */ void start_tft_dma(uint32_t *src_ptr, uint16_t byte_cnt) { - while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) {} + while ((MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_STATUS)) { + ; + } if (MXC_DMA->ch[g_dma_channel_tft].status & MXC_F_DMA_STATUS_CTZ_IF) { MXC_DMA->ch[g_dma_channel_tft].status = MXC_F_DMA_STATUS_CTZ_IF; @@ -396,10 +400,8 @@ int main(void) Camera_Power(POWER_ON); //MXC_Delay(300000); printf("\n\nCats-vs-Dogs Feather Demo\n"); -#elif defined(BOARD_EVKIT_V1) - printf("\n\nCats-vs-Dogs Evkit Demo\n"); #else - printf("\n\nCats-vs-Dogs CAM02 Demo\n"); + printf("\n\nCats-vs-Dogs Evkit Demo\n"); #endif /* Enable cache */ @@ -461,8 +463,7 @@ int main(void) #ifdef BOARD_EVKIT_V1 camera_write_reg(0x11, 0x1); // set camera clock prescaller to prevent streaming overflow -#endif -#ifdef BOARD_FTHR_REVA +#else camera_write_reg(0x11, 0x0); // set camera clock prescaller to prevent streaming overflow #endif @@ -476,10 +477,8 @@ int main(void) TFT_Print(buff, 20, 130, font_2, snprintf(buff, sizeof(buff), "PRESS PB1(SW1) TO START!")); #endif -#if defined(BOARD_EVKIT_V1) || defined(BOARD_FTHR_REVA) printf("********** Press PB1(SW1) to capture an image **********\r\n"); while (!PB_Get(0)) {} -#endif #ifdef TFT_ENABLE MXC_TFT_ClearScreen(); @@ -567,12 +566,9 @@ int main(void) #ifdef ASCII_ART asciiart((uint8_t *)input_0); -#endif - -#if defined(BOARD_EVKIT_V1) || defined(BOARD_FTHR_REVA) printf("********** Press PB1(SW1) to capture an image **********\r\n"); - while (!PB_Get(0)) {} #endif + while (!PB_Get(0)) {} } return 0; diff --git a/Examples/MAX78000/CNN/cats-dogs_demo/project.mk b/Examples/MAX78000/CNN/cats-dogs_demo/project.mk index 3655680a37f..3866379ae28 100644 --- a/Examples/MAX78000/CNN/cats-dogs_demo/project.mk +++ b/Examples/MAX78000/CNN/cats-dogs_demo/project.mk @@ -14,20 +14,9 @@ # Add your config here! # Uncomment the line below to build for the MAX78000FTHR #BOARD=FTHR_RevA -# Uncomment the line below to build for the MAX78000CAM02 -#BOARD = CAM02_RevA -ifeq ($(BOARD),EvKit_V1) -CAMERA = OV7692 -endif - -ifeq ($(BOARD),FTHR_RevA) -CAMERA = OV7692 -endif - -ifeq ($(BOARD),CAM02_RevA) -CAMERA = GC0308 -endif +$(info Note: This project is designed and tested for the OV7692 only.) +override CAMERA=OV7692 # Set a higher optimization level. The increased performance # is required for the CameraIF DMA code to work within the @@ -57,3 +46,9 @@ endif ifeq ($(BOARD),CAM01_RevA) $(error ERR_NOTSUPPORTED: This project is not supported for the CAM01 board) endif + +ifeq ($(BOARD),CAM02_RevA) +$(error ERR_NOTSUPPORTED: This project is not supported for the CAM02 board) +endif + + diff --git a/Examples/MAX78000/ImgCapture/project.mk b/Examples/MAX78000/ImgCapture/project.mk index 7f3441d7ad7..949dc364339 100644 --- a/Examples/MAX78000/ImgCapture/project.mk +++ b/Examples/MAX78000/ImgCapture/project.mk @@ -7,8 +7,6 @@ # ********************************************************** -# Note: To change the target board, see https://analogdevicesinc.github.io/msdk//USERGUIDE/#board-support-packages - # Project options: # Set to 1 to enable, 0 to disable CONSOLE = 1 @@ -30,10 +28,6 @@ ifeq ($(BOARD),CAM01_RevA) CAMERA = HM0360_COLOR endif -ifeq ($(BOARD),CAM02_RevA) -CAMERA = GC0308 -endif - ifeq ($(BOARD),FTHR_RevA) CAMERA = OV7692 endif