diff --git a/build/libraries/camera/ARM7/camera_i2c.c b/build/libraries/camera/ARM7/camera_i2c.c index 24444cc..2e03018 100644 --- a/build/libraries/camera/ARM7/camera_i2c.c +++ b/build/libraries/camera/ARM7/camera_i2c.c @@ -31,11 +31,11 @@ extern BOOL CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Subsampling_16_7M_50Hz( void ); typedef BOOL (*CameraI2CPresetFunc)(void); static CameraI2CPresetFunc gs_preset[] = { - CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M_PLLoff_hVGA, - CAMERAi_I2CPreset_A3AFX_EVT2_30fps_16M_QVGA, +// CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M_PLLoff_hVGA, +// CAMERAi_I2CPreset_A3AFX_EVT2_30fps_16M_QVGA, CAMERAi_I2CPreset_A3AFX_EVT2_20fps_16M, - CAMERAi_I2CPreset_320x240_noPLL_20fps, - CAMERAi_I2CPreset_320x240_PLL_30fps, +// CAMERAi_I2CPreset_320x240_noPLL_20fps, +// CAMERAi_I2CPreset_320x240_PLL_30fps, CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Scaledown_16_7M_50Hz, CAMERAi_I2CPreset_A3AFX_EVT3_30fps_Subsampling_16_7M_50Hz, }; diff --git a/build/libraries/camera/ARM7/convert.pl b/build/libraries/camera/ARM7/convert.pl index 06d5a56..c331087 100644 --- a/build/libraries/camera/ARM7/convert.pl +++ b/build/libraries/camera/ARM7/convert.pl @@ -23,9 +23,8 @@ my $file_head_format =<<'EOF'; //#define PRINT_DEBUG #ifdef PRINT_DEBUG -#include -#define DBG_PRINTF vlink_dos_printf -#define DBG_CHAR vlink_dos_put_console +#include +#define DBG_PRINTF OS_TPrintf #else #define DBG_PRINTF( ... ) ((void)0) #define DBG_CHAR( c ) ((void)0) diff --git a/build/tests/camera/camera-1/ARM9/src/main.c b/build/tests/camera/camera-1/ARM9/src/main.c index 7420ac9..3cb1260 100644 --- a/build/tests/camera/camera-1/ARM9/src/main.c +++ b/build/tests/camera/camera-1/ARM9/src/main.c @@ -35,6 +35,8 @@ static void CameraIntr(void); *---------------------------------------------------------------------------*/ void TwlMain() { + CAMERAResult result; + // OS_Init(); GX_Init(); @@ -63,8 +65,13 @@ void TwlMain() CAMERA_SelectCamera(CAMERA_SELECT_FIRST); CAMERA_PowerOn(); - CAMERA_I2CInit(); - CAMERA_I2CPreset(CAMERA_PRESET_QVGA_30SD); + result = CAMERA_I2CInit(); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + OS_TPrintf("CAMERA_I2CInit was failed. (%d)\n", result); + result = CAMERA_I2CPreset(CAMERA_PRESET_VGA_20); + if (result != CAMERA_RESULT_SUCCESS_TRUE) + OS_TPrintf("CAMERA_I2CPreset was failed. (%d)\n", result); + CAMERA_SetCropping(0, 0, 320, 240); CAMERA_SetTrimmingParamsCenter(WIDTH, HEIGHT, 320, 240); // clipped by camera i/f CAMERA_SetTrimming(TRUE); @@ -119,7 +126,7 @@ void CameraIntr(void) OSTick current = OS_GetTick(); if (MIi_IsExDmaBusy(DMA_NO)) { - OS_TPrintf("Why??? %d\n", (int)current); + OS_TPrintf("DMA was not done until VBlank.\n"); OS_SetIrqCheckFlag(OS_IE_CAM); return; } diff --git a/include/twl/camera/common/types.h b/include/twl/camera/common/types.h index 39f2593..f371dd8 100644 --- a/include/twl/camera/common/types.h +++ b/include/twl/camera/common/types.h @@ -46,16 +46,16 @@ typedef enum { } CameraSpecialMode; typedef enum { - CAMERA_PRESET_HVGA_20, - CAMERA_PRESET_DS_30, +// CAMERA_PRESET_HVGA_20, +// CAMERA_PRESET_DS_30, CAMERA_PRESET_VGA_20, - CAMERA_PRESET_QVGA_20, - CAMERA_PRESET_QVGA_30, +// CAMERA_PRESET_QVGA_20, +// CAMERA_PRESET_QVGA_30, CAMERA_PRESET_QVGA_30SD, CAMERA_PRESET_QVGA_30SS, CAMERA_PRESET_MAX, - CAMERA_PRESET_DEFAULT = CAMERA_PRESET_HVGA_20 + CAMERA_PRESET_DEFAULT = CAMERA_PRESET_QVGA_30SD } CameraPreset; diff --git a/include/twl/i2c/ARM7/i2c.h b/include/twl/i2c/ARM7/i2c.h index 5fafb08..ef8422c 100644 --- a/include/twl/i2c/ARM7/i2c.h +++ b/include/twl/i2c/ARM7/i2c.h @@ -32,7 +32,7 @@ extern "C" { typedef enum { I2C_SLAVE_CODEC_TP = 0, - I2C_SLAVE_CAMERA = 2, + I2C_SLAVE_CAMERA, I2C_SLAVE_NUM } I2CSlave;