X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=property%2Fcalibration_detect.c;h=d9902b816ea37daa3a456e21515cb2f6a8c2a556;hb=refs%2Fchanges%2F30%2F165630%2F1;hp=e5a5614368c274c3910b94da21f85e2b2a667831;hpb=70c9b062ef932fd9af53168d16ff9767f0654630;p=profile%2Fmobile%2Fplatform%2Fkernel%2Fu-boot-tm1.git diff --git a/property/calibration_detect.c b/property/calibration_detect.c index e5a5614..d9902b8 100644 --- a/property/calibration_detect.c +++ b/property/calibration_detect.c @@ -1,5 +1,6 @@ #include "calibration_detect.h" #include +#include static unsigned int nv_buffer[256]={0}; static int s_is_calibration_mode = 0; @@ -38,13 +39,15 @@ typedef struct tag_cali_command { unsigned char sub_cmd; } COMMAND_T; +extern int get_mode_from_gpio(void); +extern int do_fs_file_read(char *mpart, char *filenm, void *buf, int len); extern int serial_tstc(void); static unsigned long long start_time; static unsigned long long now_time; -static caliberate_device = CALIBERATE_DEVICE_NULL; +static int caliberate_device = CALIBERATE_DEVICE_NULL; static void send_caliberation_request(void) { @@ -123,14 +126,12 @@ unsigned int check_caliberate(uint8_t * buf, int len) int pctool_mode_detect_uart(void) { - int ret; int i ; unsigned int caliberate_mode; uint8_t buf[20]; int got = 0; printf("%s\n", "uart calibrate detecting"); - loff_t off = 0; send_caliberation_request(); #ifdef CONFIG_MODEM_CALIBERATE @@ -138,7 +139,7 @@ int pctool_mode_detect_uart(void) buf[i] = i + 'a'; start_time = get_timer_masked(); - printf("uart calibrate configuration start_time=%d\n", start_time); + printf("uart calibrate configuration start_time=%llu\n", start_time); while (1) { got = receive_caliberation_response(buf, sizeof(buf)); if (caliberate_device == CALIBERATE_DEVICE_UART) @@ -247,11 +248,12 @@ int check_pctool_cmd(uint8_t* buf, int len) return command; } -extern int power_button_pressed(void); static int count_ms; static unsigned long long start_time; static unsigned long long now_time; +#if 0 +extern int power_button_pressed(void); static int recheck_power_button(void) { int cnt = 0; @@ -270,6 +272,8 @@ static int recheck_power_button(void) } }while(1); } +#endif + int is_timeout(void) { @@ -307,7 +311,7 @@ void cali_usb_debug(uint8_t *buf) if(usb_trans_status) printf("func: %s line %d usb trans with error %d\n", __func__, __LINE__, usb_trans_status); ret = gs_read(buf, &count); - printf("func: %s readly read %d\n", __func__, count); + printf("func: %s readly read %d ret(%d)\n", __func__, count, ret); if(usb_trans_status) printf("func: %s line %d usb trans with error %d\n", __func__, __LINE__, usb_trans_status); for(i = 0; istatus = status; aprsp->length = CALIBERATE_CNF_LEN; - total_len = translate_packet((unsigned char*)pctool_cnf_buf,(unsigned char*)rsp_ptr,((MSG_HEAD_T*)rsp_ptr)->len); + total_len = translate_packet((char*)pctool_cnf_buf,(char*)rsp_ptr,((MSG_HEAD_T*)rsp_ptr)->len); free(rsp_ptr); return total_len; } @@ -483,8 +485,7 @@ int pctool_mode_detect(void) { int ret , command; - unsigned int caliberate_mode; - loff_t off = 0; + printf("%s\n", "uart cooperating with pc tool"); if(get_mode_from_gpio()) return pctool_mode_detect_uart();