diff --git a/branches/flower_toriaezu2/batt_params.c b/branches/flower_toriaezu2/batt_params.c index a863711..b427620 100644 --- a/branches/flower_toriaezu2/batt_params.c +++ b/branches/flower_toriaezu2/batt_params.c @@ -102,22 +102,22 @@ const bt_param_ bt_param[ /*_BT_PARAM_NUM_*/ ] = // { 0xF5, 0xF3 } // compare max, min }, - // bt_PARAM_SNAKE_PANA + // bt_PARAM_SNAKE_PANA '13 0422 再調整版 { { - 0x9D, 0xA0, 0xA8, 0xF0, 0xAD, 0x90, 0xAF, 0x00, - 0xB3, 0x00, 0xB3, 0xE0, 0xB4, 0xA0, 0xB5, 0x40, - 0xB6, 0x30, 0xB7, 0xE0, 0xB8, 0xC0, 0xBE, 0x70, - 0xC1, 0x40, 0xC4, 0x20, 0xC9, 0xA0, 0xD0, 0x30, - 0x01, 0x10, 0x06, 0x00, 0x2C, 0x20, 0x0D, 0xA0, - 0x37, 0x00, 0x37, 0x30, 0x47, 0xF0, 0x28, 0xF0, - 0x25, 0xF0, 0x37, 0x30, 0x10, 0xF0, 0x14, 0xF0, - 0x0F, 0x70, 0x0D, 0x00, 0x0D, 0x00, 0x0D, 0x00, + 0x9D, 0x80, 0xA3, 0x60, 0xA9, 0x50, 0xAD, 0x90, + 0xAF, 0x60, 0xB1, 0x60, 0xB3, 0x70, 0xB4, 0xE0, + 0xB6, 0x20, 0xB7, 0xF0, 0xB9, 0xA0, 0xBC, 0xB0, + 0xBF, 0xB0, 0xC5, 0xB0, 0xCB, 0x90, 0xD1, 0x50, + 0x00, 0xC0, 0x03, 0x40, 0x06, 0x80, 0x18, 0x20, + 0x16, 0xA0, 0x16, 0x20, 0x30, 0x00, 0x34, 0xA0, + 0x27, 0xC0, 0x23, 0x40, 0x11, 0xC0, 0x0F, 0xE0, + 0x0F, 0xE0, 0x0E, 0xE0, 0x0C, 0x20, 0x0C, 0x20 }, 2, - { 106, (-256* 0.925), (-256* 2.3) }, - 0xDA30, // = 55856 - { 0xE9, 0xE7 }, + { 89, (-256* 0.9), (-256* 2.5) }, + 56144, // 0xDB50 + { 232, 230 }, } diff --git a/branches/flower_toriaezu2/config.h b/branches/flower_toriaezu2/config.h index d901fac..f2cfdbc 100644 --- a/branches/flower_toriaezu2/config.h +++ b/branches/flower_toriaezu2/config.h @@ -7,10 +7,10 @@ */ #define MCU_VER_MAJOR 0x02 -#define MCU_VER_MINOR 0x25 +#define MCU_VER_MINOR 0x2F /* -内部管理バージョン 2.33 +内部管理バージョン 2.34 */ // ビルドスイッチ diff --git a/branches/flower_toriaezu2/task_sys.c b/branches/flower_toriaezu2/task_sys.c index ff54d88..3bc4024 100644 --- a/branches/flower_toriaezu2/task_sys.c +++ b/branches/flower_toriaezu2/task_sys.c @@ -36,7 +36,7 @@ extern void nop8(); -static void chk_emergencyExit(); +static err chk_emergencyExit(); static void force_off_check(); static void send_getup_to_soc(); static void chk_sleep(); @@ -260,8 +260,13 @@ void tsk_sys( ) break; case ON: //--------------------------------------------- - chk_emergencyExit(); // PMICによる強制電源断チェック + if( chk_emergencyExit() == ERR_ERR ) + { + // PMICによる強制電源断チェック // デバッガがreset1をアサートすることもある。そのときは全部リセット + system_status.pwr_state = OFF_TRIG; + renge_task_interval_run_force = true; + } chk_sleep(); // SLP監視。system_status.pwr_state いじります。行儀悪い @@ -280,7 +285,12 @@ void tsk_sys( ) break; case SLEEP: //------------------------------------------ - chk_emergencyExit(); + if( chk_emergencyExit() == ERR_ERR ) + { + system_status.pwr_state = OFF_TRIG; + renge_task_interval_run_force = true; + } + chk_awake(); // スリープから復帰 force_off_check(); @@ -622,7 +632,6 @@ static void irqs_finalize() IF1 = 0; IF2 = 0; } -} @@ -648,13 +657,13 @@ static err leds_closed() PMICが電源異常で止めたか確認 ***********************************************/ -static void chk_emergencyExit(){ +static err chk_emergencyExit(){ static u8 shirobako_power_control_count; // wifi モジュールキャリブレーションモードでreset1を自分から下げてるときはチェックをパス if( is_wifi_calib_resets_ast ) { - return; + return ERR_SUCCESS; } if( shirobako_power_control_count == 0 ) @@ -665,8 +674,7 @@ static void chk_emergencyExit(){ { // リセットが下がってる /// PMICが異常終了判断をした - system_status.pwr_state = OFF_TRIG; - renge_task_interval_run_force = true; + return ERR_ERR; } else { @@ -694,9 +702,8 @@ static void chk_emergencyExit(){ { #ifndef _RVD_ // 白箱は電源を切りたいらしい - system_status.pwr_state = OFF_TRIG; - renge_task_interval_run_force = true; shirobako_power_control_count = WAIT_SHIROBAKO_POW_CONTROL; + return ERR_ERR; #endif } else @@ -717,6 +724,7 @@ static void chk_emergencyExit(){ } } } + return ERR_SUCCESS; } diff --git a/branches/flower_toriaezu2/vreg_ctr.c b/branches/flower_toriaezu2/vreg_ctr.c index 064f1ac..b16957d 100644 --- a/branches/flower_toriaezu2/vreg_ctr.c +++ b/branches/flower_toriaezu2/vreg_ctr.c @@ -177,6 +177,10 @@ void vreg_ctr_write( u8 adrs, u8 data ) pool.vreg_c_ext.vreg_c_free[ vreg_free_adrs ] = data; vreg_free_adrs ++; } + else + { + dbg_NOP(); + } break; case VREG_CX_FREE_ADRS: @@ -510,8 +514,15 @@ u8 vreg_ctr_read( u8 adrs ) } else if( adrs == VREG_CX_FREE_DATA ) { + if( vreg_free_adrs >= VREG_C_FREE_SIZE ) + { + temp = 0x00; + } + else + { temp = pool.vreg_c_ext.vreg_c_free[ vreg_free_adrs ]; // vreg_free_adrs ++; // ここで加算してしまうとインデックスがずれる + } return( temp ); } else if( adrs == VREG_CX_INFO ) diff --git a/branches/flower_toriaezu2/vreg_ctr.h b/branches/flower_toriaezu2/vreg_ctr.h index 00c2140..b0629e2 100644 --- a/branches/flower_toriaezu2/vreg_ctr.h +++ b/branches/flower_toriaezu2/vreg_ctr.h @@ -133,11 +133,6 @@ // VREG_C_LED_NOTIFY_FLAG #define REG_BIT_IN_LOOP ( 1 << 0 ) -// RBR control (0x57) -#define REG_BIT_FLIGHT ( 1 << 1 ) -#define REG_BIT_RESET_n ( 1 << 0 ) - - // HAL bitfields 0 #define REG_BIT_HAL0_PM_EXTDC_n ( 1 << 7 ) #define REG_BIT_HAL0_BT_IN_CHG_n ( 1 << 6 )