@@ -24,40 +24,43 @@ static StaticTask_t taskBuffer;
2424static StackType_t taskStack [TASK_STACK_SIZE ];
2525
2626void vTask1 (void * pvParameters ) {
27+ obc_error_code_t errCode ;
2728 sciPrintf ("Starting Arducam Demo\r\n" );
2829 camera_id_t selectedCamera = PRIMARY ;
29- initCamera (selectedCamera );
30+ LOG_IF_ERROR_CODE ( initCamera (selectedCamera ) );
3031 uint8_t temp ;
31- arducamReadSensorPowerControlReg (selectedCamera , & temp );
32+ LOG_IF_ERROR_CODE ( arducamReadSensorPowerControlReg (selectedCamera , & temp ) );
3233 sciPrintf ("Power Control Reg:0x%X\r\n" , temp );
3334
3435 // Read Camera Sensor ID
3536 uint16_t cam_id ;
36- ov5642GetChipID (& cam_id );
37+ LOG_IF_ERROR_CODE ( ov5642GetChipID (& cam_id ) );
3738 sciPrintf ("Sensor ID: %X\r\n" , cam_id );
3839
3940 // Test Reg operations
4041 uint8_t byte = 0x55 ;
4142 sciPrintf ("Writing %d to test reg\r\n" , byte );
42- arducamWriteTestReg (selectedCamera , byte );
43+ LOG_IF_ERROR_CODE ( arducamWriteTestReg (selectedCamera , byte ) );
4344 byte = 0 ;
44- arducamReadTestReg (selectedCamera , & byte );
45+ LOG_IF_ERROR_CODE ( arducamReadTestReg (selectedCamera , & byte ) );
4546 sciPrintf ("Read %d from test reg\r\n" , byte );
4647
4748 // Camera Configuration
4849 sciPrintf ("Configuring Camera\r\n" );
49- camConfigureSensor ();
50+ LOG_IF_ERROR_CODE ( camConfigureSensor () );
5051 while (1 ) {
5152 // Capture
5253 sciPrintf ("Starting Image Capture\r\n" );
53- startImageCapture (selectedCamera );
54+ LOG_IF_ERROR_CODE (startImageCapture (selectedCamera ));
55+ sciPrintf ("Image Capture Started\r\n" );
56+
5457 while (isCaptureDone (selectedCamera ) == OBC_ERR_CODE_CAMERA_CAPTURE_INCOMPLETE )
5558 ;
5659 sciPrintf ("Image Capture Done ^_^\r\n" );
5760
5861 // Read image size
5962 uint32_t img_len = 0 ;
60- arducamReadFIFOSize (selectedCamera , & img_len );
63+ LOG_IF_ERROR_CODE ( arducamReadFIFOSize (selectedCamera , & img_len ) );
6164 sciPrintf ("image len: %d \r\n" , img_len );
6265
6366 // Read image from FIFO
@@ -72,10 +75,12 @@ void vTask1(void *pvParameters) {
7275 }
7376 } while (ret == OBC_ERR_CODE_CAMERA_IMAGE_READ_INCOMPLETE );
7477 sciPrintf ("\r\n" );
78+
79+ return ;
7580 }
7681
7782 // Put Camera on standby (gets pretty hot if left powered on for too long)
78- standbyCamera (selectedCamera );
83+ LOG_IF_ERROR_CODE ( standbyCamera (selectedCamera ) );
7984 while (1 )
8085 ;
8186}
0 commit comments