diff --git a/branches/0.15(sdk0.9_E3_fix_vol)/hoge.bin b/branches/0.15(sdk0.9_E3_fix_vol)/hoge.bin index 3578c00..2b6bbd0 100644 Binary files a/branches/0.15(sdk0.9_E3_fix_vol)/hoge.bin and b/branches/0.15(sdk0.9_E3_fix_vol)/hoge.bin differ diff --git a/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.pri b/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.pri index 8b9d725..9a46c84 100644 --- a/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.pri +++ b/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.pri @@ -80,8 +80,8 @@ Kanji=SJIS [Source] Geometry=317, -7, 707, 899 Window=Normal -DispStart=41 -CaretPos=89,1 +DispStart=68 +CaretPos=69,0 Mode=Normal DispFile= Address1= @@ -139,19 +139,11 @@ SaveRange=Screen SaveStart= SaveEnd= Accumulative=ON -[Source1] -Geometry=0, 0, 707, 899 -Window=Normal -DispStart=262 -CaretPos=110,2 -Mode=Normal -DispFile=..\..\trunk\led.c -Accumulative=ON [Assemble] Geometry=75, 362, 600, 400 Window=Normal -DispStart=688 -CaretPos=688,27 +DispStart=15269 +CaretPos=15269,27 Address1= Address2= Address3= diff --git a/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.prk b/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.prk index 6a537f3..a646e01 100644 --- a/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.prk +++ b/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.prk @@ -14,14 +14,10 @@ OpenFile7=sw.c,0,574,367,1818,1093,43,36,43,0 OpenFile8=ProjectWindow PrjPos=0,2,754,3,253 OpenFile9=vreg_ctr.h,0,632,184,1876,910,13,2,13,0 -OpenFile10=adc.c,0,88,88,1332,814,118,154,0,0 -OpenFile11=renge\renge_defs.h,0,667,22,1514,748,11,3,11,0 -OpenFile12=config.h,0,352,352,1596,1078,15,11,15,0 -OpenFile13=led.c,0,352,352,1596,1078,0,46,0,0 -OpenFile14=user_define.h,0,303,256,1547,982,0,1,0,0 -OpenFile15=task_debug.c,0,0,0,1244,726,27,70,26,0 -OpenFile16=OutputWindow +OpenFile10=config.h,0,352,352,1596,1078,2,27,0,0 +OpenFile11=OutputWindow OutputPos=0,572,1038,46,1104 +OpenFile12=adc.c,0,88,88,1332,814,5,288,0,0 ActivePRJ=yav_mcu_bsr.prj [ProjectWindow] ProjectWindowDispType=0 diff --git a/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.sdb b/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.sdb index 32de1bc..4331e97 100644 --- a/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.sdb +++ b/branches/0.15(sdk0.9_E3_fix_vol)/yav_mcu_bsr.sdb @@ -34,7 +34,7 @@ T=4bf0d1dd 6=led.h 7=adc.h [magic.c] -T=4bf1f107 +T=4bf21819 1=config.h [WDT.c] T=4bf0d1dd @@ -157,7 +157,7 @@ T=4bf0d1dd T=4bf0d1dd 1=config.h [config.h] -T=4bf0e3aa +T=4bf21845 [user_define.h] T=4bf0d1dd [bsr_system.h] diff --git a/trunk/accero.c b/trunk/accero.c index bbd75b4..132c3ef 100644 --- a/trunk/accero.c +++ b/trunk/accero.c @@ -257,8 +257,7 @@ __interrupt void intp23_ACC_ready( ) { if( ACC_VALID == 1 ) { -// todo -// renge_task_immed_add( tsk_cbk_accero ); + renge_task_immed_add( tsk_cbk_accero ); } } } diff --git a/trunk/adc.c b/trunk/adc.c index 2c8a769..b2848d1 100644 --- a/trunk/adc.c +++ b/trunk/adc.c @@ -173,26 +173,6 @@ void tsk_adc( ) } } - - // TUNE_LED /////////////////////////////////// - // ここで?仕様? - { - switch ( vreg_ctr[VREG_C_LED_TUNE] ) - { - case LED_TUNE_ILM_ON: - LED_duty_3d = vreg_ctr[VREG_C_LED_BRIGHT]; - break; - - case LED_TUNE_ILM_SVR: - LED_duty_3d = vreg_ctr[VREG_C_TUNE] / 16; - break; - - case LED_TUNE_ILM_OFF: - default: - LED_duty_3d = 0; - break; - } - } adc_updated = 0; } } @@ -246,7 +226,6 @@ static u8 getmean3( u8 * hist ) /* ========================================================  自前で次のチャンネル   一通り終わったら止める - // todo 値が飛ぶことがある? ======================================================== */ __interrupt void int_adc( ) { diff --git a/trunk/i2c_ctr.c b/trunk/i2c_ctr.c index fef4857..d192c0b 100644 --- a/trunk/i2c_ctr.c +++ b/trunk/i2c_ctr.c @@ -203,9 +203,15 @@ __interrupt void int_iic_ctr( ) { case( VREG_C_ACC_HOSU_HIST ): case( VREG_C_INFO ): - case( VREG_C_FREE_DATA ): case( VREG_C_LED_NOTIFY_DATA ): case( VREG_C_LED_POW ): + case( VREG_C_FREE_DATA ): + break; + case( VREG_C_FREE_ADRS ): + if( reg_adrs == VREG_C_FREE_ADRS ) + { + reg_adrs = VREG_C_FREE_DATA; + } break; default: iic_burst_state = 0; // 保険 diff --git a/trunk/i2c_mcu.c b/trunk/i2c_mcu.c index c780db0..5a0c683 100644 --- a/trunk/i2c_mcu.c +++ b/trunk/i2c_mcu.c @@ -9,7 +9,7 @@ #pragma nop #pragma inline // memcpy()をインライン展開する(の方が小さい!) -#include "incs.h" +#include "incs_loader.h" #include "i2c_mcu.h" diff --git a/trunk/led.c b/trunk/led.c index 4d50b15..dbe9240 100644 --- a/trunk/led.c +++ b/trunk/led.c @@ -26,6 +26,7 @@ #define BIT_MD123 1 #define BIT_MD0 0 + // ======================================================== static void led_pow_normal( ); static void led_pow_hotaru( ); @@ -43,11 +44,14 @@ uni_info_LED info_LED; uni_led_red_batt_empty led_red_batt_empty; +u8* p_LED_duty_WiFi; + + + // ======================================================== #define led_fade_to( now, goal ) now = fade_to( now, goal ) - /* ======================================================== reg_ledをgoalになるまでグラデーションする とりあえず、ステップ固定 @@ -137,10 +141,37 @@ void LED_init( ) TDR00 = LED_BRIGHT_MAX - 1; // 周期 10bit + // お知らせLEDを識別 // + system_status.info_fullcolor = 0; + p_LED_duty_WiFi = &LED_duty_old_WiFi; + if( system_status.model != MODEL_TS_BOARD ) + { + INFO_LED_IS_FULLCOLOR_PU = 1; + if( !INFO_LED_IS_FULLCOLOR_n ) + { + system_status.info_fullcolor = 1; + p_LED_duty_WiFi = &LED_duty_WiFi; + } + INFO_LED_IS_FULLCOLOR_PU = 0; + } + +#ifdef _FORCE_INFO_LED_FULLCOLOR_ + // todo debug // + system_status.info_fullcolor = 1; + p_LED_duty_WiFi = &LED_duty_WiFi; +#endif + if( system_status.reboot ) { vreg_ctr[VREG_C_LED_POW] = LED_POW_ILM_AUTO; - LED_duty_pow_blu = LED_BRIGHT_MAX; + if( system_status.info_fullcolor ) + { + LED_duty_pow_blu = LED_BRIGHT_MAX; + } + else + { + LED_duty_old_pow_blu = LED_BRIGHT_MAX; + } } } @@ -271,6 +302,7 @@ void tsk_led_pow( ) case ( LED_POW_ILM_ONLY_RED ): LED_duty_old_pow_blu = 0; LED_duty_old_pow_red = LED_BRIGHT_MAX; + break; case ( LED_POW_ILM_ONLY_BLUE ): LED_duty_old_pow_blu = LED_BRIGHT_MAX; @@ -354,21 +386,7 @@ static void led_pow_normal_old( ) if( vreg_ctr[VREG_C_BT_REMAIN] <= BATT_TH_EMPTY ) { // 赤点滅 - led_fade_to( LED_duty_pow_blu, 0 ); -#if 0 - state++; - if( state < 127 ) - { - LED_pow_red = 0; - } - else - { - LED_pow_red = 1; - } - return; -#endif - led_fade_to( LED_duty_notify_grn, 0 ); - led_fade_to( LED_duty_notify_blu, 0 ); + led_fade_to( LED_duty_old_pow_blu, 0 ); state += 1; if( state < 16 ) @@ -379,13 +397,11 @@ static void led_pow_normal_old( ) if( ( led_red_batt_empty.bits & ( 1 << red_blink_poi )) != 1 ) { - LED_pow_red = 1; - LED_duty_notify_red = 255; + LED_duty_old_pow_red = LED_BRIGHT_MAX; } else { - LED_pow_red = 0; - LED_duty_notify_red = 0; + LED_duty_old_pow_red = LED_BRIGHT_MAX; } red_blink_poi += 1; @@ -397,15 +413,14 @@ static void led_pow_normal_old( ) else if( vreg_ctr[VREG_C_BT_REMAIN] <= BATT_TH_LO ) { // 赤点灯 - led_fade_to( LED_duty_pow_blu, 0 ); - LED_pow_red = 1; + led_fade_to( LED_duty_old_pow_blu, 0 ); + LED_duty_old_pow_red = LED_BRIGHT_MAX; return; - } else { // 青点灯 - led_fade_to( LED_duty_pow_blu, vreg_ctr[VREG_C_LED_BRIGHT] ); + led_fade_to( LED_duty_old_pow_blu, vreg_ctr[VREG_C_LED_BRIGHT] ); LED_pow_red = 0; } @@ -429,7 +444,7 @@ static void led_pow_hotaru( ) return; } - delay = 10; + delay = 4; switch ( state ) { @@ -502,7 +517,7 @@ static void led_pow_hotaru_old( ) return; } - delay = 10; + delay = 4; switch ( state ) { @@ -513,12 +528,12 @@ static void led_pow_hotaru_old( ) if( vreg_ctr[VREG_C_BT_REMAIN] <= BATT_TH_LO ) { blue_to = 0; - LED_pow_red = 1; + LED_duty_old_pow_red = vreg_ctr[VREG_C_LED_BRIGHT]; } else { blue_to = vreg_ctr[VREG_C_LED_BRIGHT]; - LED_pow_red = 0; + LED_duty_old_pow_red = 0; } break; @@ -526,7 +541,7 @@ static void led_pow_hotaru_old( ) // フェードアウト if( vreg_ctr[VREG_C_BT_REMAIN] <= BATT_TH_LO ) { - LED_pow_red = 0; + LED_duty_old_pow_red = 0; } else { @@ -536,19 +551,19 @@ static void led_pow_hotaru_old( ) } // LED更新 - if( LED_duty_pow_blu != blue_to ) + if( LED_duty_old_pow_blu != blue_to ) { - if( LED_duty_pow_blu > blue_to ) + if( LED_duty_old_pow_blu > blue_to ) { - LED_duty_pow_blu -= 1; + LED_duty_old_pow_blu -= 1; } else { - LED_duty_pow_blu += 2; + LED_duty_old_pow_blu += 2; } } - if( LED_duty_pow_blu == blue_to ) + if( LED_duty_old_pow_blu == blue_to ) { state += 1; } @@ -562,7 +577,6 @@ static void led_pow_hotaru_old( ) /* ======================================================== * 割り込みそのものは使いません * LED_Wifi 3 - todo .old からのマージ ======================================================== */ void tsk_led_wifi( ) { @@ -579,47 +593,69 @@ void tsk_led_wifi( ) // 送信パルスのラッチ if( WIFI_txLatch ) // 割り込みフラグそのものを使ってしまう - { - WIFI_txLatch = 0; - flag_wifi_TX = 2; - } + { + WIFI_txLatch = 0; + flag_wifi_TX = 2; + } if( flag_wifi_TX != 0 ) + { + vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_WIFI_TX; + // 送信パターン + switch ( state_wifi_tx ) { - vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_WIFI_TX; - // 送信パターン - switch ( state_wifi_tx ) - { - case ( 1 ): - case ( 3 ): - case ( 5 ): - LED_duty_WiFi = 0; - break; - default: - LED_duty_WiFi = vreg_ctr[VREG_C_LED_BRIGHT]; - } - state_wifi_tx++; - if( state_wifi_tx == 32 ) - { - state_wifi_tx = 0; - flag_wifi_TX -= 1; - } - task_interval = 22; - return; + case ( 1 ): + case ( 3 ): + case ( 5 ): + *p_LED_duty_WiFi = 0; + break; + default: + *p_LED_duty_WiFi = vreg_ctr[VREG_C_LED_BRIGHT]; } - else + state_wifi_tx++; + if( state_wifi_tx == 32 ) { - // 送信フラグ待ち + state_wifi_tx = 0; + flag_wifi_TX -= 1; + } + task_interval = 22; + return; + } + else + { + task_interval = 30; + // 送信フラグ待ち vreg_ctr[ VREG_C_STATUS_1 ] &= ~REG_BIT_WIFI_TX; if( vreg_ctr[VREG_C_LED_WIFI] == WIFI_LED_OFF ) { - LED_duty_WiFi = 0; + if( *p_LED_duty_WiFi == 0 ) + { + return; + } + else + { + *p_LED_duty_WiFi -= 1; + } } else { - LED_duty_WiFi = vreg_ctr[VREG_C_LED_BRIGHT]; + if( *p_LED_duty_WiFi == vreg_ctr[VREG_C_LED_BRIGHT] ) + { + return; + } + else + { + if( *p_LED_duty_WiFi < vreg_ctr[VREG_C_LED_BRIGHT] ) + { + *p_LED_duty_WiFi += 3; + } + else + { + *p_LED_duty_WiFi -= 3; + } + } } - task_interval = 100; + task_interval = 3; return; } } @@ -635,6 +671,7 @@ void tsk_led_notify( ) // static u8 task_interval; static u8 time_to_next_frame; static u8 frame; + static u8 loops_to_go; static st_LED_dim_status LED_dim_status_info_R, LED_dim_status_info_G, LED_dim_status_info_B; if( vreg_ctr[VREG_C_BT_REMAIN] <= BATT_TH_EMPTY ) @@ -648,41 +685,54 @@ void tsk_led_notify( ) { time_to_next_frame = info_LED.info_LED.term; - frame += 1; - // 最後のフレームリピート - if( frame > NOTIFY_LED_TERM ) + // 最後のフレームリピート( bool ) + if( frame >= NOTIFY_LED_TERM ) { - if( !info_LED.info_LED.last_loop ) + if( info_LED.info_LED.last_loop == 255 ) { - frame = 0; - vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP; + vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] |= REG_BIT_IN_LOOP; } else { - frame = NOTIFY_LED_TERM; - vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] |= REG_BIT_IN_LOOP; + if( loops_to_go != 0 ) + { + loops_to_go -= 1; + } + else + { + loops_to_go = info_LED.info_LED.last_loop; + frame = 0; + } } } - - if( frame < NOTIFY_LED_TERM ) + else { - LED_dim_status_info_R.to = info_LED.info_LED.red[frame] * 128; - LED_dim_status_info_G.to = info_LED.info_LED.grn[frame] * 128; - LED_dim_status_info_B.to = info_LED.info_LED.blu[frame] * 128; - - // グラデーションのデルタを計算 - LED_dim_status_info_R.delta = (( LED_dim_status_info_R.to - LED_dim_status_info_R.now ) ) / info_LED.info_LED.fade_time; - LED_dim_status_info_G.delta = (( LED_dim_status_info_G.to - LED_dim_status_info_G.now ) ) / info_LED.info_LED.fade_time; - LED_dim_status_info_B.delta = (( LED_dim_status_info_B.to - LED_dim_status_info_B.now ) ) / info_LED.info_LED.fade_time; + vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP; + frame += 1; } + LED_dim_status_info_R.to = info_LED.info_LED.red[frame] * 128; + LED_dim_status_info_G.to = info_LED.info_LED.grn[frame] * 128; + LED_dim_status_info_B.to = info_LED.info_LED.blu[frame] * 128; + + // グラデーションのデルタを計算 + LED_dim_status_info_R.delta = (( LED_dim_status_info_R.to - LED_dim_status_info_R.now ) ) / info_LED.info_LED.fade_time; + LED_dim_status_info_G.delta = (( LED_dim_status_info_G.to - LED_dim_status_info_G.now ) ) / info_LED.info_LED.fade_time; + LED_dim_status_info_B.delta = (( LED_dim_status_info_B.to - LED_dim_status_info_B.now ) ) / info_LED.info_LED.fade_time; + } time_to_next_frame -= 1; - led_fade_to2( LED_duty_notify_red, &LED_dim_status_info_R ); - led_fade_to2( LED_duty_notify_grn, &LED_dim_status_info_G ); - led_fade_to2( LED_duty_notify_blu, &LED_dim_status_info_B ); - + if( system_status.info_fullcolor ) + { + led_fade_to2( LED_duty_notify_blu, &LED_dim_status_info_B ); + led_fade_to2( LED_duty_notify_red, &LED_dim_status_info_R ); + led_fade_to2( LED_duty_notify_grn, &LED_dim_status_info_G ); + } + else + { + led_fade_to2( LED_duty_old_NOTIFY, &LED_dim_status_info_B ); + } } @@ -699,6 +749,7 @@ void tsk_led_cam( ) static u8 state_led_cam = 0; static u8 task_interval; static u8 state_led_cam_twl; + u8 temp_led_brightness; if( task_interval != 0 ) { @@ -713,24 +764,24 @@ void tsk_led_cam( ) { case ( CAM_LED_OFF ): default: - LED_CAM = 0; + temp_led_brightness = 0; state_led_cam = 0; break; case ( CAM_LED_ON ): - LED_CAM = 1; + temp_led_brightness = 1; state_led_cam = 0; break; case ( CAM_LED_BLINK ): if( state_led_cam == 0 ) { - LED_CAM = 1; + temp_led_brightness = 1; state_led_cam = 1; } else { - LED_CAM = 0; + temp_led_brightness = 0; state_led_cam = 0; } task_interval = 250; @@ -739,7 +790,7 @@ void tsk_led_cam( ) case ( CAM_LED_ON_PLUSE ): if( state_led_cam == 0 ) { - LED_CAM = 1; + temp_led_brightness = 1; state_led_cam = 1; task_interval = 250; } @@ -752,7 +803,7 @@ void tsk_led_cam( ) case ( CAM_LED_OFF_PLUSE ): if( state_led_cam == 0 ) { - LED_CAM = 0; + temp_led_brightness = 0; state_led_cam = 1; task_interval = 250; } @@ -765,19 +816,19 @@ void tsk_led_cam( ) case ( CAM_LED_BY_TWL ): switch ( vreg_twl[ REG_TWL_INT_ADRS_CAM ] ){ // switchのネストとか… case( TWL_CAMLED_OFF ): - LED_CAM = 0; + temp_led_brightness = 0; state_led_cam = 0; break; case( TWL_CAMLED_BLINK ): if( state_led_cam == 0 ) { - LED_CAM = 1; + temp_led_brightness = 1; state_led_cam = 1; } else { - LED_CAM = 0; + temp_led_brightness = 0; state_led_cam = 0; } task_interval = 250; @@ -786,11 +837,28 @@ void tsk_led_cam( ) case( TWL_CAMLED_ON ): case( TWL_CAMLED_DEF_ON ): default: - LED_CAM = 1; + temp_led_brightness = 1; state_led_cam = 1; break; } } + + // 輝度更新 // + if( system_status.info_fullcolor ) + { + LED_CAM = temp_led_brightness; + } + else + { + if( temp_led_brightness == 0 ) + { + LED_duty_old_CAM = 0; + } + else + { + LED_duty_old_CAM = 255; + } + } return; } diff --git a/trunk/led.h b/trunk/led.h index 3a1c2fd..e2858b9 100644 --- a/trunk/led.h +++ b/trunk/led.h @@ -18,7 +18,7 @@ #define LED_CAM P4.2 -// 旧仕様 +// 旧仕様 ///////////////////////////// // LED_DUTY #define LED_duty_old_pow_blu TDR06 #define LED_duty_old_pow_red TDR07 @@ -27,7 +27,7 @@ #define LED_duty_old_CAM TDR02 #define LED_duty_old_3d TDR01 // wifi2はPWMできません。 -#define LED_CHARGE P2.4 +//#define LED_CHARGE P2.4 @@ -101,7 +101,7 @@ enum typedef struct{ u8 term; // 1フレーム何チック? u8 fade_time; // 何チックで次のフレームの色に達するか - u8 last_loop; // 最終フレームを + u8 last_loop; // 最終フレームを繰り返す? u8 resv1; u8 red[32]; u8 grn[32]; @@ -138,10 +138,14 @@ typedef struct{ sx16 now; // 小数点以下を覚えておかなくてはならないため }st_LED_dim_status; + + // ==================================== void LED_init( ); void LED_stop( ); + extern void tsk_led_cam(); + #endif diff --git a/trunk/loader.c b/trunk/loader.c index 1693091..13dd648 100644 --- a/trunk/loader.c +++ b/trunk/loader.c @@ -219,26 +219,15 @@ void hdwinit2( ) #ifdef _MCU_BSR_ # ifdef _MODEL_CTR_ # ifdef _SW_HOME_ENABLE_ - PU20 = 0b00010101; + PU20 = 0b00010001; # else - PU20 = 0b00000101; + PU20 = 0b00000001; # endif # else - PU20 = 0b00000100; + PU20 = 0b00000000; # endif - if( !INFO_LED_IS_FULLCOLOR_n ) - { - system_status.info_fullcolor = 1; - } - else - { - system_status.info_fullcolor = 0; - } - INFO_LED_IS_FULLCOLOR_PM = 0; - INFO_LED_IS_FULLCOLOR_PU = 0; #endif - #ifdef _MCU_BSR_ PM0 = 0b11111111; // BSRマイコンでは、reset1は監視のみになる。 #else diff --git a/trunk/pm.c b/trunk/pm.c index ef69c91..0eb66af 100644 --- a/trunk/pm.c +++ b/trunk/pm.c @@ -32,6 +32,7 @@ unsigned char temp_co_up; unsigned char temp_co_dn; BT_VENDER battery_manufacturer = BT_VENDER_NOT_CHECKED; +u8 reg_shadow; // NTR PMIC レジスタミラー // ======================================================== @@ -275,30 +276,24 @@ err PM_sys_pow_on( ) wait_ms( DELAY_PM_TW_PWUP ); // 無事電源が起動したかチェック。 -#ifdef _PMIC_CTR_ +# ifdef _PMIC_CTR_ if( !PM_chk_LDSW() ) { return ( ERR_ERR ); // reset1はほっといて良い } PM_reset_neg(); -#else +# else RESET1_neg; if( !RESET1_n ) { RESET1_ast; return ( ERR_ERR ); // reset1はほっといて良い } -#endif +# endif FCRAM_RST_neg; RESET2_neg; wait_ms( 100 ); - { - // CODEC 不定レジスタ初期化 - u8 codec_reg_init[3] = { 0,0,0 }; - iic_mcu_write( IIC_SLA_CODEC, CODEC_REG_PM, 3, codec_reg_init ); - } - #else // TWL PMIC u8 temp; @@ -333,11 +328,15 @@ err PM_sys_pow_on( ) return ( ERR_ERR ); } - { // CODEC 不定レジスタ初期化 +#endif + + { + // CODEC 不定レジスタ初期化 u8 codec_reg_init[3] = { 0,0,0 }; iic_mcu_write( IIC_SLA_CODEC, CODEC_REG_PM, 3, codec_reg_init ); + + reg_shadow = 0; // こんなところで... } -#endif return ( ERR_SUCCESS ); } @@ -432,7 +431,6 @@ __interrupt void intp6_PM_irq( ) ======================================================== */ task_status_immed ntr_pmic_comm( ) { - static u8 reg_shadow; u8 reg1_old; u8 irq_work = 0; @@ -882,15 +880,13 @@ void BT_init( ) raw_adc_temperatureに入っている値を℃に変換するとともに、 ・レジスタにセット ・残量ICにセット - todo ======================================================== */ task_status_immed BT_temp_update( ) { static u8 count = 0; // たまにしか書きに行かない static u8 rawdat_old; -// static s16 temperature; // todo - static unsigned long temperature; // todo + static unsigned long temperature; u16 newrcomp; /* @@ -972,7 +968,6 @@ void BT_get_left(){ } else if( bt_voltage_low_count == 12 + 3 * 5 ) { // …時間切れ。強制的に切る - vreg_ctr[ VREG_C_LED_POW ] = LED_POW_ILM_ONLY_RED; system_status.pwr_state = OFF_TRIG; renge_task_interval_run_force = 1; } diff --git a/trunk/task_misc.c b/trunk/task_misc.c index 43688a4..5321191 100644 --- a/trunk/task_misc.c +++ b/trunk/task_misc.c @@ -10,6 +10,7 @@ #include "accero.h" #include "adc.h" #include "i2c_mcu.h" +#include "led.h" #ifdef _MCU_BSR_ @@ -114,6 +115,33 @@ void tsk_misc( ) set_irq( VREG_C_IRQ2, REG_BIT_TWL_VER_READ ); } } + + // TUNE_LED /////////////////////////////////// + { + // これはold版もおなじポートを使ってます。 + if( vreg_ctr[VREG_C_LED_TUNE] == LED_TUNE_ILM_OFF ) + { + if( LED_duty_3d != 0 ) + { + LED_duty_3d -= 1; + } + } + else + { + if( LED_duty_3d != vreg_ctr[VREG_C_LED_BRIGHT] ) + { + if( LED_duty_3d < vreg_ctr[VREG_C_LED_BRIGHT] ) + { + LED_duty_3d += 1; + } + else + { + LED_duty_3d -= 1; + } + } + } + } + } @@ -230,6 +258,10 @@ task_status_immed tski_mcu_info_read() IICA = iic_mcu_read_a_byte( IIC_SLA_BT_GAUGE, BT_GAUGE_REG_VERSION + 1 ); break; + case( 5 ): + IICA = iic_mcu_read_a_byte( IIC_SLA_BT_GAUGE, BT_GAUGE_REG_VERSION + 1 ); + break; + default: goto end; } diff --git a/trunk/task_sys.c b/trunk/task_sys.c index 74650d2..93272e3 100644 --- a/trunk/task_sys.c +++ b/trunk/task_sys.c @@ -171,6 +171,9 @@ void tsk_sys( ) IIC_twl_Init( ); RTC_32k_on( ); + vreg_twl_init( ); + vreg_ctr_reset( ); + KRM = 0b00000000; system_status.poweron_reason = NONE; diff --git a/trunk/vreg_ctr.c b/trunk/vreg_ctr.c index 6592d47..1a3e311 100644 --- a/trunk/vreg_ctr.c +++ b/trunk/vreg_ctr.c @@ -40,6 +40,12 @@ void vreg_ctr_init( ) { vreg_ctr[VREG_C_LED_BRIGHT] = 0xFF; + vreg_ctr[VREG_C_VCOM_T] = VCOM_DEFAULT_T; + vreg_ctr[VREG_C_VCOM_B] = VCOM_DEFAULT_B; +} + +void vreg_ctr_reset( ) +{ #ifdef _PMIC_TWL_ vreg_ctr[VREG_C_MCU_VER_MAJOR] = MCU_VER_MAJOR; #else @@ -47,13 +53,22 @@ void vreg_ctr_init( ) #endif vreg_ctr[VREG_C_MCU_VER_MINOR] = MCU_VER_MINOR; - vreg_ctr[VREG_C_VCOM_T] = VCOM_DEFAULT_T; - vreg_ctr[VREG_C_VCOM_B] = VCOM_DEFAULT_B; + vreg_ctr[ VREG_C_LED_BRIGHT ] = 0x28, + vreg_ctr[ VREG_C_LED_POW ] = 0; + vreg_ctr[ VREG_C_LED_WIFI ] = 0; + vreg_ctr[ VREG_C_LED_CAM ] = 0; + vreg_ctr[ VREG_C_LED_TUNE ] = 0; + { + u8 i; + for( i = 0; i < sizeof( uni_info_LED ); i++ ) + { + info_LED.bindata[ iic_burst_state ] = 0; + } + } } - // ******************************************************** // I2C仮想レジスタに書きます。 // 引数 adrs は内部アドレス @@ -67,7 +82,7 @@ void vreg_ctr_write( u8 adrs, u8 data ) case ( VREG_C_MCU_STATUS ): vreg_twl[ REG_TWL_INT_ADRS_MODE ] = ( ( data & 0xC0 ) >> 6 ); - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_MCU_STATUS ] = data; break; case ( VREG_C_VCOM_T ): @@ -80,6 +95,7 @@ void vreg_ctr_write( u8 adrs, u8 data ) case ( VREG_C_DBG2 ): vreg_ctr[adrs] = data; break; + case ( VREG_C_DBG3 ): if( ( vreg_ctr[VREG_C_DBG1] == 'j' ) && ( vreg_ctr[VREG_C_DBG2] == 'h' ) @@ -88,7 +104,7 @@ void vreg_ctr_write( u8 adrs, u8 data ) renge_task_immed_add( tski_firm_update ); IICAMK = 1; } - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_DBG3 ] = data; break; case ( VREG_C_IRQ_MASK0 ): @@ -104,7 +120,7 @@ void vreg_ctr_write( u8 adrs, u8 data ) { renge_task_immed_add( do_command0 ); } - vreg_ctr[adrs] |= data; + vreg_ctr[ VREG_C_COMMAND0 ] |= data; break; case ( VREG_C_COMMAND2 ): @@ -133,12 +149,12 @@ void vreg_ctr_write( u8 adrs, u8 data ) { // TWLに割り込みを入れる /// 実際に割り込みを入れるのはSoC - vreg_twl[REG_TWL_INT_ADRS_IRQ] = ( ( data & REG_BIT_SEND_TWL_PWSW_DET ) != 0 ) ? REG_BIT_TWL_IRQ_PWSW_DET : 0x00; //pwsw_det + vreg_twl[REG_TWL_INT_ADRS_IRQ] = ( ( data & REG_BIT_SEND_TWL_PWSW_DET ) != 0 ) ? REG_BIT_TWL_IRQ_PWSW_DET : 0x00; //pwsw_det vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_RESET_DET ) != 0 ) ? REG_BIT_TWL_IRQ_RESET : 0x00; //reset_req - vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_OFF_DET ) != 0 ) ? REG_BIT_TWL_IRQ_OFF : 0x00; //off_req + vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_OFF_DET ) != 0 ) ? REG_BIT_TWL_IRQ_OFF : 0x00; //off_req - vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_BATT_LOW ) != 0 ) ? REG_BIT_TWL_IRQ_BT_LOW : 0x00; //batt_low + vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_BATT_LOW ) != 0 ) ? REG_BIT_TWL_IRQ_BT_LOW : 0x00; //batt_low vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_BATT_EMPTY ) != 0 ) ? REG_BIT_TWL_IRQ_BT_EMPTY : 0x00; //batt_empty vreg_twl[REG_TWL_INT_ADRS_IRQ] |= ( ( data & REG_BIT_SEND_TWL_VOL_CLICK ) != 0 ) ? REG_BIT_TWL_IRQ_VOL_CHANGE : 0x00; //vol_changed @@ -153,13 +169,13 @@ void vreg_ctr_write( u8 adrs, u8 data ) break; case ( VREG_C_LED_BRIGHT ): - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_LED_BRIGHT ] = data; break; case ( VREG_C_LED_POW ): if( iic_burst_state == 0 ) { - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_LED_POW ] = data; iic_burst_state += 1; } else if( iic_burst_state < 5 ) @@ -212,50 +228,50 @@ void vreg_ctr_write( u8 adrs, u8 data ) case ( VREG_C_RTC_COMP ): SUBCUD = data; - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_RTC_COMP ] = data; break; case ( VREG_C_RTC_ALARM_MIN ): rtc_alarm_dirty = 1; - vreg_ctr[adrs] = ( data & 0x7F ); + vreg_ctr[ VREG_C_RTC_ALARM_MIN ] = ( data & 0x7F ); break; case ( VREG_C_RTC_ALARM_HOUR ): rtc_alarm_dirty = 1; - vreg_ctr[adrs] = ( data & 0x3F ); + vreg_ctr[ VREG_C_RTC_ALARM_HOUR ] = ( data & 0x3F ); break; // 書くだけでよい case ( VREG_C_RTC_ALARM_DAY ): - vreg_ctr[adrs] = ( data & 0x3F ); + vreg_ctr[ VREG_C_RTC_ALARM_DAY ] = ( data & 0x3F ); break; case ( VREG_C_RTC_ALARM_MONTH ): - vreg_ctr[adrs] = ( data & 0x1F ); + vreg_ctr[ VREG_C_RTC_ALARM_MONTH ] = ( data & 0x1F ); break; case ( VREG_C_RTC_ALARM_YEAR ): - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_RTC_ALARM_YEAR ] = data; break; case ( VREG_C_ACC_CONFIG ): renge_task_immed_add( acc_hosu_set ); - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_ACC_CONFIG ] = data; break; case ( VREG_C_ACC_R_ADRS ): renge_task_immed_add( acc_read ); - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_ACC_R_ADRS ] = data; break; case ( VREG_C_ACC_W_ADRS ): - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_ACC_W_ADRS ] = data; break; case ( VREG_C_ACC_W_BUF ): renge_task_immed_add( acc_write ); - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_ACC_W_BUF ] = data; break; case ( VREG_C_ACC_HOSU_L ): @@ -272,11 +288,11 @@ void vreg_ctr_write( u8 adrs, u8 data ) break; case ( VREG_C_ACC_HOSU_HOUR_BOUNDARY ): - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_ACC_HOSU_HOUR_BOUNDARY ] = data; break; case ( VREG_C_FREE_ADRS ): - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_FREE_ADRS ] = data; break; case ( VREG_C_FREE_DATA ): @@ -300,7 +316,7 @@ void vreg_ctr_write( u8 adrs, u8 data ) WDTE = 0xAA; break; } - vreg_ctr[adrs] = data; + vreg_ctr[ VREG_C_COMMAND3 ] = data; break; default: @@ -319,6 +335,7 @@ void vreg_ctr_write( u8 adrs, u8 data ) u8 vreg_ctr_read( u8 adrs ) { static u16 rsub_temp; + u8 temp; // RTCは読み出し途中に繰り上がるのを避けるため if( ( VREG_C_RTC_SEC <= adrs ) && ( adrs <= VREG_C_RTC_YEAR ) ) @@ -335,7 +352,9 @@ u8 vreg_ctr_read( u8 adrs ) } else if( adrs == VREG_C_FREE_DATA ) { - return( pool.vreg_c_ext.vreg_c_free[ vreg_ctr[VREG_C_FREE_ADRS]++ ] ); + temp = pool.vreg_c_ext.vreg_c_free[ vreg_ctr[VREG_C_FREE_ADRS] ]; + vreg_ctr[VREG_C_FREE_ADRS] += 1; + return( temp ); } else if( adrs == VREG_C_RTC_SEC_FINE_L ) { diff --git a/trunk/vreg_ctr.h b/trunk/vreg_ctr.h index fd212d8..42a19fb 100644 --- a/trunk/vreg_ctr.h +++ b/trunk/vreg_ctr.h @@ -253,6 +253,7 @@ enum VREG_C /*============================================================================*/ void vreg_ctr_init( ); +void vreg_ctr_reset( ); void vreg_ctr_write( u8 adrs, u8 data ); u8 vreg_ctr_read( u8 phy_adrs ); void vreg_ctr_after_read( u8 adrs ); diff --git a/trunk/vreg_twl.c b/trunk/vreg_twl.c index a562d4d..de4f18e 100644 --- a/trunk/vreg_twl.c +++ b/trunk/vreg_twl.c @@ -28,6 +28,9 @@ extern bit twl_ver_read; void vreg_twl_init( ) { vreg_twl[ REG_TWL_INT_ADRS_MODE ] = 0x03; + vreg_twl[ REG_TWL_ADRS_IRQ ] = 0; + vreg_twl[ REG_TWL_ADRS_CAM ] = 0; + vreg_twl[ REG_TWL_ADRS_TEMP0 ] = 0; } diff --git a/trunk/yav_mcu_bsr.plg b/trunk/yav_mcu_bsr.plg index 5348c75..49bf2bd 100644 --- a/trunk/yav_mcu_bsr.plg +++ b/trunk/yav_mcu_bsr.plg @@ -1,9 +1,26 @@ C:\WINDOWS\system32\cmd.exe /c touch magic.c -"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\bin\cc78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -irenge -i"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r" -ms -qvjl3wt -sainter_asm -zp -no magic.c +"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\bin\cc78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -irenge -i"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r" -ms -qvjwt -sainter_asm -zp -no magic.c Compilation complete, 0 error(s) and 0 warning(s) found. "C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\magic.asm Assembly complete, 0 error(s) and 0 warning(s) found. -"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\lk78k0r.exe" -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -obsr.lmf "..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r\s0rm.rel" -go85h,0FC00h,1024 -gi0FFFFFFFFFFFFFFFFFFFFh -pbsr_k0r.map -nkd -gb7EFBFFh -b"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\lib78k0r\fsl.lib" -bcl0rdm.lib -bcl0rm.lib -bcl0rmf.lib -i"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r" -dbsr_mcu.dr -s -w0 loader.rel pm.rel i2c_ctr.rel main.rel magic.rel WDT.rel i2c_mcu.rel i2c_twl.rel ini_VECT.rel led.rel rtc.rel vreg_ctr.rel vreg_twl.rel adc.rel renge.rel accero.rel self_flash.rel reboot.rel sw.rel task_debug.rel task_misc.rel task_sys.rel pedo_alg_thre_det2.rel +"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\bin\cc78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -irenge -i"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r" -ms -qvjwt -sainter_asm -zp -no vreg_ctr.c +vreg_ctr.c(84) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(143) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(152) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(153) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(155) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(157) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(158) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(160) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(191) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(236) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(241) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(246) : CC78K0R warning W0401: Conversion may lose significant digits +vreg_ctr.c(250) : CC78K0R warning W0401: Conversion may lose significant digits +Compilation complete, 0 error(s) and 13 warning(s) found. +"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\vreg_ctr.asm +Assembly complete, 0 error(s) and 0 warning(s) found. +"C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\lk78k0r.exe" -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -obsr.lmf "..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r\s0rm.rel" -go85h,0FC00h,1024 -gi0FFFFFFFFFFFFFFFFFFFFh -pbsr_k0r.map -nkd -gb7EFBFFh -b"C:\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\lib78k0r\fsl.lib" -bcl0rdm.lib -bcl0rm.lib -bcl0rmf.lib -i"C:\Program Files\NEC Electronics Tools\CC78K0R\W2.10\lib78k0r" -dbsr_mcu.dr -s -w0 loader.rel pm.rel i2c_ctr.rel main.rel magic.rel WDT.rel i2c_mcu.rel i2c_twl.rel led.rel rtc.rel vreg_ctr.rel vreg_twl.rel adc.rel renge.rel accero.rel self_flash.rel sw.rel task_debug.rel task_misc.rel task_sys.rel pedo_alg_thre_det2.rel ini_VECT.rel task_status.rel Link complete, 0 error(s) and 0 warning(s) found. "C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\oc78k0r.exe" -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -o.\bsr.hex -nu -ki bsr.lmf Object Conversion Complete, 0 error(s) and 0 warning(s) found. @@ -13,4 +30,4 @@ intel-HEX to bsr bin converter file converted! -Build Total error(s) : 0 Total warning(s) : 0 +Build Total error(s) : 0 Total warning(s) : 13 diff --git a/trunk/yav_mcu_bsr.pri b/trunk/yav_mcu_bsr.pri index 80d52f6..cbb15ff 100644 --- a/trunk/yav_mcu_bsr.pri +++ b/trunk/yav_mcu_bsr.pri @@ -4,7 +4,7 @@ Target=IDK0R32G [Configuration] Chip=uPD79F0104 Internal Rom=32KB -Internal Ram=1536KB +Internal Ram=1536B Clock=Target Sub Clock=Target Peripheral Break=0x1 @@ -78,10 +78,10 @@ Symbol Type=OFF Language=C Kanji=SJIS [Source] -Geometry=4, 9, 871, 684 +Geometry=285, 104, 812, 601 Window=Normal -DispStart=387 -CaretPos=388,0 +DispStart=60 +CaretPos=84,0 Mode=Normal DispFile= Address1= @@ -139,11 +139,19 @@ SaveRange=Screen SaveStart= SaveEnd= Accumulative=ON +[Source1] +Geometry=75, 75, 812, 601 +Window=Normal +DispStart=343 +CaretPos=357,23 +Mode=Normal +DispFile=vreg_ctr.c +Accumulative=ON [Assemble] Geometry=19, 497, 600, 400 Window=Normal -DispStart=18910 -CaretPos=18910,27 +DispStart=704 +CaretPos=704,27 Address1= Address2= Address3= @@ -195,8 +203,8 @@ Ascii=OFF Idtag=OFF Address= DispStart=00004F70 -CaretPosData=20, 255 -CaretPosAscii=53248, 256 +CaretPosData=0, 1271 +CaretPosAscii=3, 1271 Address1= Address2= Address3= @@ -251,7 +259,7 @@ Destination=0 [I/O Port] Line=0 [Stack] -Geometry=0, 0, 0, 0 +Geometry=0, 0, 400, 300 Window=Hide Boundary=0 Mode=Proper @@ -814,7 +822,7 @@ L529=IICWL1 L530=IICWH1 L531=SVA1 [Local Variable] -Geometry=697, 793, 400, 300 +Geometry=772, 680, 400, 244 Window=Normal Boundary=13041851 Mode=Proper @@ -873,15 +881,15 @@ Boundary=174 Pickup=OFF Name=Functional Register Bank=0 -RP0=3 -RP1=3 -RP2=3 -RP3=3 -PC=3 -SP=3 -PSW=7 -ES=3 -CS=3 +RP0=1 +RP1=1 +RP2=1 +RP3=1 +PC=1 +SP=1 +PSW=1 +ES=1 +CS=1 [Event Manager] Geometry=0, 0, 0, 0 Window=Hide @@ -957,75 +965,50 @@ Detail=OFF Last Name= Count=0 [Variable] -Geometry=884, 10, 440, 793 +Geometry=884, 10, 440, 653 Window=Normal -Boundary=13762700 -0=.list_id,P,N,A,+,1 -1=.psw,P,R,A,+,1 -2=.tasks_immed,P,N,A,+,1 -Line=3 +Boundary=18088086 +0=.info_LED,.,N,A,+,1 +1=.list_id,P,N,A,+,1 +2=.TDR02,P,S,A,+,1 +3=.P4.2,P,S,A,+,1 +4=+pool,.,N,A,-,1 +5=.p_LED_duty_WiFi,.,N,A,+,1 +6=.system_status,.,N,A,+,1 +7=.psw,P,R,A,+,1 +8=.vreg_ctr,P,N,A,+,1 +9=.tasks_immed,P,N,A,+,1 +Line=10 [Quick Watch] -0=IICA1,P,A,1 -1=TRC1,P,A,1 -2=P7.5,P,A,1 -3=PM7.6,P,A,1 -4=PM7.5,P,A,1 -5=PM12.0,P,A,1 -6=P12.0,P,A,1 -7=iic_mcu_bus_status,P,A,1 -8=temp,P,A,1 -9=adc_raw_vol,P,A,1 -10=force_update_adc,P,A,1 -11=DMAMK1,P,A,1 -12=DMAIF1,P,A,1 -13=tasks_immed,P,A,1 -14=list_id,P,A,1 -15=psw,P,A,1 +0=iic_mcu_bus_status,P,A,1 +1=temp,P,A,1 +2=adc_raw_vol,P,A,1 +3=force_update_adc,P,A,1 +4=DMAMK1,P,A,1 +5=DMAIF1,P,A,1 +6=tasks_immed,P,A,1 +7=list_id,P,A,1 +8=psw,P,A,1 +9=system_status,P,A,1 +10=p_LED_duty_WiFi,P,A,1 +11=P4.2,P,A,1 +12=TDR02,P,A,1 +13=vreg_ctr,P,A,1 +14=info_LED,P,A,1 +15=pool,P,A,1 [Software Break] Geometry=1085, 803, 500, 296 Window=Normal Width=150 30 200 100 -Name0=Swb00001 -Address0=task_misc.c#_tski_mcu_info_read+0x3d +Name0=Swb00015 +Address0=pm.c#_ntr_pmic_comm+0x32 Window0=ASM Status0=ON -Name1=Swb00002 -Address1=task_misc.c#_tski_mcu_info_read+0x56 +Name1=Swb00001 +Address1=vreg_ctr.c#_vreg_ctr_read+0x3c Window1=ASM Status1=ON -Name2=Swb00003 -Address2=task_misc.c#_tski_mcu_info_read+0x56 -Window2=ASM -Status2=ON -Name3=Swb00005 -Address3=task_misc.c#_tski_mcu_info_read+0x56 -Window3=ASM -Status3=ON -Name4=Swb00004 -Address4=task_misc.c#_tski_mcu_info_read+0x21 -Window4=ASM -Status4=ON -Name5=Swb00015 -Address5=pm.c#_ntr_pmic_comm+0x32 -Window5=ASM -Status5=ON -Name6=Swb00011 -Address6=loader.c#_main+0x1b -Window6=ASM -Status6=ON -Name7=Swb00008 -Address7=rtc.c#_RTC_init+0x1 -Window7=ASM -Status7=ON -Name8=Swb00006 -Address8=loader.c#_main+0x74 -Window8=ASM -Status8=ON -Name9=Swb00007 -Address9=loader.c#_main+0x71 -Window9=ASM -Status9=ON -Count=10 +Count=2 [Reset] Debugger=ON Symbol=OFF diff --git a/trunk/yav_mcu_bsr.prj b/trunk/yav_mcu_bsr.prj index 103fa9d..732524d 100644 --- a/trunk/yav_mcu_bsr.prj +++ b/trunk/yav_mcu_bsr.prj @@ -1,12 +1,12 @@ [ProjectManager] Version=6.00 -Path=C:\78k_data\yav-mcu-basara\ +Path=C:\78k_data\yav-mcu-basara\trunk\ Title=yav-mcu Series=78K0R.PM Device=uPD79F0104 DeviceVer=E1.00b DebugMode=1 -Target=C:\78k_data\yav-mcu-basara\bsr.lmf +Target=bsr.lmf [BuildMode0] BuildModeName=Debug Build TargetFile=0 @@ -260,7 +260,7 @@ ZB= Etcetera0= Etcetera1=boot.lmf CommandFile=0 -OFILE=C:\78k_data\yav-mcu-basara\bsr.lmf +OFILE=C:\78k_data\yav-mcu-basara\trunk\bsr.lmf [Options.LK78K0R 3] Version=100 O0=bsr_bsr.lmf @@ -1036,12 +1036,12 @@ Include22=pedometer.h Include23=adc.h Include24=led.h Include25=batt_params.h -Include26=..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h -Include27=i2c_twl_defs.h -Include28=renge\renge_task_intval.h -Include29=..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h -Include30=i2c_twl.h -Include31=sw.h -Include32=self_flash.h -Include33=pool.h -Include34=pedo_lpf_coeff.h +Include26=i2c_twl_defs.h +Include27=renge\renge_task_intval.h +Include28=i2c_twl.h +Include29=sw.h +Include30=self_flash.h +Include31=pool.h +Include32=pedo_lpf_coeff.h +Include33=..\..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h +Include34=..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h diff --git a/trunk/yav_mcu_bsr.prk b/trunk/yav_mcu_bsr.prk index ea3e85b..06a7bcb 100644 --- a/trunk/yav_mcu_bsr.prk +++ b/trunk/yav_mcu_bsr.prk @@ -1,5 +1,5 @@ [ProjectManager] -FrameMax=1 +FrameMax=0 FrameX=255 FrameY=34 FrameCX=1299 @@ -7,21 +7,25 @@ FrameCY=1044 OpenFile1=renge\renge.h,0,502,637,1746,1394,29,16,29,0 OpenFile2=jhl_defs.h,0,250,539,1494,1265,0,10,8,0 OpenFile3=renge\\renge_defs.h,0,293,307,1537,1033,18,37,18,0 -OpenFile4=renge\renge_defs.h,0,667,22,1514,748,0,16,0,0 -OpenFile5=task_sys.c,0,330,330,1574,1056,0,172,37,0 -OpenFile6=loader.c,0,296,307,1286,923,20,214,20,0 -OpenFile7=pm.h,0,254,446,1244,1062,0,115,0,0 -OpenFile8=sw.c,0,574,367,1818,1093,43,36,43,0 -OpenFile9=vreg_ctr.h,0,632,184,1876,910,8,40,25,0 -OpenFile10=pedo_alg_thre_det2.c,0,132,132,1376,858,0,12,0,0 -OpenFile11=adc.c,0,286,286,1530,1012,0,145,0,0 -OpenFile12=self_flash.c,0,154,154,1398,880,7,365,7,0 -OpenFile13=ProjectWindow +OpenFile4=task_sys.c,0,330,330,1574,1056,0,172,37,0 +OpenFile5=loader.c,0,296,307,1286,923,20,214,20,0 +OpenFile6=pm.h,0,254,446,1244,1062,0,115,0,0 +OpenFile7=sw.c,0,574,367,1818,1093,43,36,43,0 +OpenFile8=vreg_ctr.h,0,632,184,1876,910,8,40,25,0 +OpenFile9=pedo_alg_thre_det2.c,0,132,132,1376,858,0,12,0,0 +OpenFile10=adc.c,0,286,286,1530,1012,0,145,0,0 +OpenFile11=self_flash.c,0,154,154,1398,880,7,365,7,0 +OpenFile12=ProjectWindow PrjPos=0,2,754,3,253 -OpenFile14=magic.c,0,323,248,1567,974,0,17,0,0 -OpenFile15=config.h,0,288,71,1532,797,18,2,21,0 -OpenFile16=OutputWindow -OutputPos=0,572,1038,46,1104 +OpenFile13=magic.c,0,323,248,1567,974,0,17,0,0 +OpenFile14=led.h,0,22,22,1023,650,25,29,25,0 +OpenFile15=config.h,0,288,71,1532,797,0,28,0,0 +OpenFile16=task_misc.c,0,308,308,1552,1034,0,12,0,0 +OpenFile17=renge\renge_defs.h,0,667,22,1514,748,4,37,4,0 +OpenFile18=i2c_ctr.c,0,132,132,1376,858,20,211,16,0 +OpenFile19=vreg_ctr.c,0,154,154,1398,880,72,355,73,0 +OpenFile20=OutputWindow +OutputPos=0,536,1002,34,1092 ActivePRJ=yav_mcu_bsr.prj [ProjectWindow] ProjectWindowDispType=0 diff --git a/trunk/yav_mcu_bsr.sdb b/trunk/yav_mcu_bsr.sdb index 410aff2..308178e 100644 --- a/trunk/yav_mcu_bsr.sdb +++ b/trunk/yav_mcu_bsr.sdb @@ -1,7 +1,7 @@ [SdbInfo] Ver=5 [loader.c] -T=4bb93708 +T=4bf114e2 1=incs_loader.h 2=fsl.h 3=fsl_user.h @@ -11,21 +11,21 @@ T=4bb93708 7=rtc.h 8=reboot.h [pm.c] -T=4bb92f33 +T=4bf213b1 1=incs.h 2=adc.h 3=led.h 4=pm.h 5=renge\renge.h 6=batt_params.h -7=..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h +7=..\..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h 8=fsl_user.h [i2c_ctr.c] -T=4bb92f33 -1=incs.h -2=accero.h +T=4bf2324a +1=config.h +2=incs.h [main.c] -T=4bb92f33 +T=4bf0d1e1 1=incs_loader.h 2=WDT.h 3=rtc.h @@ -33,55 +33,55 @@ T=4bb92f33 5=accero.h 6=led.h 7=adc.h +8=pool.h [magic.c] -T=4bb94d0f +T=4bf23469 1=config.h [WDT.c] -T=4bb92f33 +T=4bf0d1e1 1=incs_loader.h [i2c_mcu.c] -T=4bb92f33 -1=incs.h +T=4bf11863 +1=incs_loader.h 2=i2c_mcu.h [i2c_twl.c] -T=4bb92f33 -1=incs.h -2=i2c_twl_defs.h -[ini_VECT.c] -T=4bb92f33 +T=4bf0d1e0 1=config.h +2=incs.h +3=i2c_twl_defs.h [led.c] -T=4bb92f33 +T=4bf213b1 1=incs.h 2=led.h [rtc.c] -T=4bb92f33 +T=4bf0d1e1 1=incs.h [vreg_ctr.c] -T=4bb92f33 +T=4bf23471 1=incs.h 2=vreg_ctr.h 3=rtc.h 4=led.h 5=accero.h 6=pm.h -7=..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h -8=fsl_user.h +7=pool.h +8=..\..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h +9=fsl_user.h [vreg_twl.c] -T=4bb92f33 +T=4bf1fe17 1=incs.h 2=jhl_defs.h -3=vreg_twl.h -4=vreg_ctr.h -5=renge\renge_task_intval.h +3=led.h +4=vreg_twl.h +5=vreg_ctr.h [adc.c] -T=4bb92f33 +T=4bf213b1 1=incs.h 2=adc.h 3=pm.h 4=led.h [renge\renge.c] -T=4bb92f32 +T=4bf0d1e0 1=renge\renge.h 2=renge\renge_task_intval.h 3=renge\renge_task_immediate.h @@ -90,43 +90,41 @@ T=4bb92f32 6=user_define.h 7=bsr_system.h [accero.c] -T=4bb92f33 -1=incs.h -2=..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h +T=4bf1000a +1=config.h +2=incs.h +3=..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h [self_flash.c] -T=4bb92f33 +T=4bf0d1e0 1=incs_loader.h -2=..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h +2=..\..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h 3=fsl_user.h 4=i2c_ctr.h -[reboot.c] -T=4bb92f33 -1=incs_loader.h +5=pool.h [sw.c] -T=4bb92f33 +T=4bf0d1e0 1=incs.h 2=i2c_twl.h 3=i2c_ctr.h 4=led.h -5=accero.h -6=pm.h -7=rtc.h +5=pm.h +6=rtc.h [task_debug.c] -T=4bb92f33 +T=4bf0d1e1 1=incs.h 2=renge\renge.h 3=pm.h -4=accero.h [task_misc.c] -T=4bb92f33 +T=4bf2178f 1=incs.h 2=renge\renge.h 3=pm.h 4=accero.h 5=adc.h 6=i2c_mcu.h +7=led.h [task_sys.c] -T=4bb92f33 +T=4bf21233 1=incs.h 2=i2c_twl.h 3=i2c_ctr.h @@ -136,14 +134,28 @@ T=4bb92f33 7=rtc.h 8=sw.h 9=adc.h +10=self_flash.h [pedo_alg_thre_det2.c] -T=4bb92f33 +T=4bf0d1e1 1=incs.h -2=..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h +2=..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h 3=accero.h 4=pedometer.h +5=pedo_lpf_coeff.h +6=pool.h +[ini_VECT.c] +T=4bf0d1e1 +1=config.h +[task_status.c] +T=4bf0d1e1 +1=incs.h +2=renge\renge.h +3=pm.h +4=accero.h +5=adc.h +6=i2c_mcu.h [incs_loader.h] -T=4bb92f33 +T=4bf0d1e1 1=jhl_defs.h 2=user_define.h 3=bsr_system.h @@ -154,49 +166,48 @@ T=4bb92f33 8=i2c_mcu.h 9=WDT.h [jhl_defs.h] -T=4bb92f33 +T=4bf0d1e0 1=config.h [config.h] -T=4bb9687f +T=4bf0d1e0 [user_define.h] -T=4bb92f33 +T=4bf0d1e1 [bsr_system.h] -T=4bb92f33 +T=4bf0d1e1 [renge\renge.h] -T=4bb92f32 +T=4bf0d1e0 1=renge\renge_defs.h 2=renge\renge_task_immediate.h [renge\renge_defs.h] -T=4bb92f32 +T=4bf0d1e0 [renge\renge_task_immediate.h] -T=4bb92f32 +T=4bf0d1e0 1=renge\renge_defs.h [vreg_ctr.h] -T=4bb92f33 +T=4bf21233 1=config.h [vreg_twl.h] -T=4bb92f33 +T=4bf0d1e0 [loader.h] -T=4bb92f33 -1=jhl_defs.h +T=4bf0d1e0 [i2c_mcu.h] -T=4bb92f33 +T=4bf0d1e0 [WDT.h] -T=4bb92f33 +T=4bf0d1e1 [fsl.h] -T=4bb92f33 +T=4bf0d1e0 [fsl_user.h] -T=4bb92f33 +T=4bf0d1e0 [i2c_ctr.h] -T=4bb92f33 +T=4bf0d1e1 [pm.h] -T=4bb92f33 +T=4bf0d1e1 [rtc.h] -T=4bb92f33 +T=4bf0d1e1 [reboot.h] -T=4bb92f33 +T=4bf0d1e1 [incs.h] -T=4bb92f33 +T=4bf0d1e0 1=jhl_defs.h 2=user_define.h 3=bsr_system.h @@ -206,29 +217,37 @@ T=4bb92f33 7=i2c_mcu.h 8=rtc.h 9=accero.h +10=pm.h [accero.h] -T=4bb92f33 +T=4bf0d1e1 1=jhl_defs.h 2=pedometer.h [pedometer.h] -T=4bb92f33 +T=4bf0d1e0 [adc.h] -T=4bb92f33 +T=4bf0d1e1 1=jhl_defs.h [led.h] -T=4bb92f33 +T=4bf13f6f [batt_params.h] -T=4bb92f33 -[..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h] -T=49a3bd4e +T=4bf0d1e1 [i2c_twl_defs.h] -T=4bb92f33 +T=4bf0d1e1 [renge\renge_task_intval.h] -T=4bb92f32 +T=4bf0d1e0 1=renge\renge_defs.h -[..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h] -T=45f12258 [i2c_twl.h] -T=4bb92f33 +T=4bf0d1e0 [sw.h] -T=4bb92f33 +T=4bf0d1e0 +[self_flash.h] +T=4bf0d1e0 +[pool.h] +T=4bf0d1e0 +1=pedometer.h +[pedo_lpf_coeff.h] +T=4bf0d1e1 +[..\..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h] +T=49a3bd4e +[..\..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h] +T=45f12258