mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-06-18 16:45:33 -04:00
戻り値の型が誤っているのを修正 動いているコードを触るなと言う格言もあるが…
無名な列挙型、一通り名前を付けた。VSのメンバ表示の可読を上げたいため。今更。 LED お知らせLED、リピート設定でなくても最終フレームフラグを立てる (パターンを差し替えるときに使ってほしかったが意味ないかもとのこと) WiFiLEDの点滅は現状(TWL同等)で良いらしい。 スリープ中だが、masterBrightnessで下げた状態にしてもらうことになりそう。 うっすらついてるかわかるか程度なら消してしまえばいいのに... 充電停止・再開温度を変更。ただし評価を待ってまたいじられるかもしれない 電池残量割り込みのデバッグコードを入れた。 加速度センサが動いていると、強制オフに時間が掛かるとの事でシステムチックタイマを数えてみたが、ジッタは増えるものの、問題無いような気がするし、手元で試しても同じ気がする。条件を確認しよう git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@189 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
parent
bec116824a
commit
611a0cbf84
@ -91,7 +91,7 @@ task_status_immed tsk_cbk_accero( )
|
||||
vreg_ctr[ VREG_C_ACC_CONFIG ] &= ~( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ );
|
||||
acc_hosu_set();
|
||||
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_ACCERO_ERR;
|
||||
return ( ERR_SUCCESS ); // タスクの削除は必要
|
||||
return ( ERR_FINISED ); // タスクの削除は必要
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -119,7 +119,7 @@ task_status_immed tsk_cbk_accero( )
|
||||
pedometer(); // •à<E280A2>”Œv
|
||||
}
|
||||
}
|
||||
return ( ERR_SUCCESS );
|
||||
return ( ERR_FINISED );
|
||||
}
|
||||
|
||||
|
||||
@ -138,7 +138,7 @@ task_status_immed acc_read( )
|
||||
{
|
||||
IRQ0_ast;
|
||||
}
|
||||
return ( ERR_SUCCESS );
|
||||
return ( ERR_FINISED );
|
||||
}
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ task_status_immed acc_write( )
|
||||
{
|
||||
IRQ0_ast;
|
||||
}
|
||||
return ( ERR_SUCCESS );
|
||||
return ( ERR_FINISED );
|
||||
}
|
||||
|
||||
|
||||
@ -173,7 +173,7 @@ task_status_immed acc_hosu_set( )
|
||||
#ifdef _MCU_BSR_
|
||||
// PMK23 = 1;
|
||||
#endif
|
||||
return ( ERR_SUCCESS ); // とりあえず、タスクは削除しなくてはならない
|
||||
return ( ERR_FINISED ); // とりあえず、タスクは削除しなくてはならない
|
||||
}else{
|
||||
vreg_ctr[ VREG_C_STATUS_1 ] &= ~REG_BIT_ACCERO_ERR;
|
||||
}
|
||||
@ -239,7 +239,7 @@ if( system_status.model == MODEL_TS_BOARD )
|
||||
iic_mcu_write( IIC_SLA_ACCEL, ( ACC_REG_CTRL1 | 0x80 ), 4, str_send_buf );
|
||||
|
||||
// ƒJƒ‰“Ç‚Ý
|
||||
if( ACC_VALID == 1 )
|
||||
if( ACC_VALID )
|
||||
{
|
||||
if( system_status.pwr_state == ON )
|
||||
{
|
||||
@ -247,7 +247,7 @@ if( system_status.model == MODEL_TS_BOARD )
|
||||
iic_mcu_read( IIC_SLA_ACCEL, ( ACC_REG_X | 0x80 ), 6, temp );
|
||||
}
|
||||
}
|
||||
return ( ERR_SUCCESS );
|
||||
return ( ERR_FINISED );
|
||||
}
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ __interrupt void intp23_ACC_ready( )
|
||||
{
|
||||
if( ( system_status.pwr_state == ON ) || ( system_status.pwr_state == SLEEP ) )
|
||||
{
|
||||
if( ACC_VALID == 1 )
|
||||
if( ACC_VALID )
|
||||
{
|
||||
renge_task_immed_add( tsk_cbk_accero );
|
||||
}
|
||||
|
@ -104,7 +104,8 @@ const u8 BT_PARAM[][64] = {
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
typedef struct _st_bt_comp
|
||||
{
|
||||
unsigned char rcomp;
|
||||
signed short temp_co_up; // 256倍したものを入れとく
|
||||
signed short temp_co_dn; // 〃
|
||||
|
@ -36,7 +36,7 @@ enum model_
|
||||
};
|
||||
|
||||
// タスクシステムの状態情報など
|
||||
typedef struct
|
||||
typedef struct _system_status_
|
||||
{
|
||||
enum pwr_state_ pwr_state;
|
||||
enum poweron_reason_ poweron_reason;
|
||||
@ -47,8 +47,7 @@ typedef struct
|
||||
unsigned char info_fullcolor:1;
|
||||
enum model_ model;
|
||||
unsigned short cnt_force_off;
|
||||
}
|
||||
system_status_;
|
||||
}system_status_;
|
||||
|
||||
|
||||
extern system_status_ system_status;
|
||||
|
@ -60,7 +60,7 @@ u8 iic_burst_state;
|
||||
|
||||
/* ========================================================
|
||||
======================================================== */
|
||||
enum
|
||||
enum IIC_STATE
|
||||
{
|
||||
IIC_IDLE = 0,
|
||||
IIC_RCV_REG_ADRS,
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "user_define.h"
|
||||
|
||||
#include "bsr_system.h"
|
||||
#include "renge.h"
|
||||
#include "renge\renge.h"
|
||||
|
||||
#include "vreg_ctr.h"
|
||||
#include "vreg_twl.h"
|
||||
|
@ -9,13 +9,10 @@ typedef signed short s16;
|
||||
typedef unsigned short ux16;
|
||||
typedef signed short sx16;
|
||||
|
||||
typedef unsigned char err;
|
||||
|
||||
// typedef unsigned char err;
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
|
||||
#define set_bit( cond, reg, pos ) \
|
||||
{ \
|
||||
if( cond ){ \
|
||||
@ -26,4 +23,42 @@ typedef unsigned char err;
|
||||
}
|
||||
|
||||
|
||||
# ifdef _WIN32
|
||||
|
||||
typedef bool bit;
|
||||
|
||||
void EI(){};
|
||||
void DI(){};
|
||||
void HALT(){};
|
||||
void NOP(){};
|
||||
|
||||
#define __interrupt
|
||||
#define __far
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned 7 :1;
|
||||
unsigned 6 :1;
|
||||
unsigned 5 :1;
|
||||
unsigned 4 :1;
|
||||
unsigned 3 :1;
|
||||
unsigned 2 :1;
|
||||
unsigned 1 :1;
|
||||
unsigned 0 :1;
|
||||
}mcu_reg;
|
||||
|
||||
mcu_reg P20;
|
||||
mcu_reg P7;
|
||||
mcu_reg P4;
|
||||
mcu_reg P2;
|
||||
|
||||
unsigned char PMK23;
|
||||
unsigned char RTCIMK;
|
||||
unsigned char WDTE;
|
||||
unsigned char PM2;
|
||||
|
||||
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
10
trunk/led.c
10
trunk/led.c
@ -550,14 +550,10 @@ void tsk_led_notify( )
|
||||
{
|
||||
time_to_next_frame = info_LED.info_LED.term;
|
||||
|
||||
// 最後のフレームリピート( bool )
|
||||
if( frame >= NOTIFY_LED_TERM -1 )
|
||||
{
|
||||
if( info_LED.info_LED.last_loop == 255 )
|
||||
{
|
||||
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] |= REG_BIT_IN_LOOP;
|
||||
}
|
||||
else
|
||||
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] |= REG_BIT_IN_LOOP;
|
||||
if( info_LED.info_LED.last_loop != 255 ) // 255:無限ループ
|
||||
{
|
||||
if( loops_to_go != 0 )
|
||||
{
|
||||
@ -573,7 +569,7 @@ void tsk_led_notify( )
|
||||
else
|
||||
{
|
||||
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP;
|
||||
frame = (( frame + 1 ) & 0x1F );
|
||||
frame = (( frame + 1 ) & 0x1F ); // ←ここでマスクをかけておかないと最終フレーム~先頭間のグラデが効かない
|
||||
}
|
||||
|
||||
LED_dim_status_info_R.to = info_LED.info_LED.red[frame] * 128;
|
||||
|
18
trunk/led.h
18
trunk/led.h
@ -70,7 +70,7 @@ enum LED_MODE_TUNE
|
||||
|
||||
|
||||
// VREG_C_WIFI_LED
|
||||
enum
|
||||
enum WIFI_LED_MODE
|
||||
{
|
||||
WIFI_LED_OFF = 0,
|
||||
WIFI_LED_ON
|
||||
@ -78,7 +78,7 @@ enum
|
||||
|
||||
|
||||
// VREG_C_WIFI_NOTIFY
|
||||
enum
|
||||
enum NOTIFY_LED_MODE
|
||||
{
|
||||
NOTIFY_LED_OFF = 0,
|
||||
NOTIFY_LED_ON,
|
||||
@ -89,7 +89,7 @@ enum
|
||||
|
||||
|
||||
// VREG_C_CAM_LED
|
||||
enum
|
||||
enum CAM_LED_MODE
|
||||
{
|
||||
CAM_LED_OFF = 0,
|
||||
CAM_LED_BLINK,
|
||||
@ -102,7 +102,8 @@ enum
|
||||
|
||||
|
||||
// お知らせLED調光関係 //
|
||||
typedef struct{
|
||||
typedef struct _st_info_LED
|
||||
{
|
||||
u8 term; // 1フレーム何チック?
|
||||
u8 fade_time; // 何チックで次のフレームの色に達するか
|
||||
u8 last_loop; // 最終フレームを繰り返す?
|
||||
@ -112,7 +113,8 @@ typedef struct{
|
||||
u8 blu[32];
|
||||
}st_info_LED;
|
||||
|
||||
typedef union{
|
||||
typedef union _uni_info_LED
|
||||
{
|
||||
st_info_LED info_LED;
|
||||
u8 bindata[ sizeof( st_info_LED ) ];
|
||||
}uni_info_LED;
|
||||
@ -121,7 +123,8 @@ extern uni_info_LED info_LED;
|
||||
|
||||
|
||||
// 赤LED 点滅向け //
|
||||
typedef struct{
|
||||
typedef struct _st_led_red_batt_empty
|
||||
{
|
||||
u8 dats[4];
|
||||
}st_led_red_batt_empty;
|
||||
|
||||
@ -131,7 +134,8 @@ extern st_led_red_batt_empty led_red_batt_empty;
|
||||
/*
|
||||
お知らせLED
|
||||
*/
|
||||
typedef struct{
|
||||
typedef struct _st_LED_dim_status
|
||||
{
|
||||
sx16 to;
|
||||
sx16 delta;
|
||||
sx16 now; // 小数点以下を覚えておかなくてはならないため
|
||||
|
106
trunk/pm.c
106
trunk/pm.c
@ -10,7 +10,7 @@
|
||||
#include "adc.h"
|
||||
#include "led.h"
|
||||
#include "pm.h"
|
||||
#include "renge.h"
|
||||
#include "renge\renge.h"
|
||||
|
||||
#include "batt_params.h"
|
||||
|
||||
@ -59,20 +59,21 @@ err PM_LCD_on( )
|
||||
|
||||
rv = PM_chk_LDSW( );
|
||||
|
||||
if( rv != 0 )
|
||||
if( rv != 0 )
|
||||
{
|
||||
// 電源起動エラーなら電源も切れてしまう。ここではケアしない
|
||||
vreg_ctr[VREG_C_STATUS] |= REG_BIT_LCD_POW;
|
||||
set_irq( VREG_C_IRQ3, REG_BIT_LCD_ON );
|
||||
|
||||
SND_DEPOP_SND_ENABLE;
|
||||
return ( ERR_ERR );
|
||||
}
|
||||
|
||||
#ifdef _PMIC_TWL_
|
||||
PM_TEG_LCD_dis( 0 );
|
||||
blset = ( PM_REG_BIT_BL_U | PM_REG_BIT_BL_L );
|
||||
#endif
|
||||
return ( rv );
|
||||
return ( ERR_SUCCESS );
|
||||
}
|
||||
|
||||
// BSR //
|
||||
@ -542,13 +543,13 @@ task_status_immed ntr_pmic_comm( )
|
||||
task_status_immed tski_PM_LCD_on()
|
||||
{
|
||||
PM_LCD_on();
|
||||
return( ERR_SUCCESS );
|
||||
return( ERR_FINISED );
|
||||
}
|
||||
|
||||
task_status_immed tski_PM_LCD_off()
|
||||
{
|
||||
PM_LCD_off();
|
||||
return( ERR_SUCCESS );
|
||||
return( ERR_FINISED );
|
||||
}
|
||||
|
||||
task_status_immed tski_PM_BL_set()
|
||||
@ -563,7 +564,7 @@ task_status_immed tski_PM_BL_set()
|
||||
while( cmd_BL != vreg_ctr[VREG_C_COMMAND2] ); // <- PM_BL_setが更新する
|
||||
vreg_ctr[VREG_C_COMMAND2] = 0;
|
||||
|
||||
return( ERR_SUCCESS );
|
||||
return( ERR_FINISED );
|
||||
}
|
||||
|
||||
|
||||
@ -624,13 +625,13 @@ void tsk_batt( )
|
||||
|
||||
// 充電 ///////////////////////////
|
||||
// 温度付きヒステリシス
|
||||
if(( 86 < raw_adc_temperature )
|
||||
&& ( raw_adc_temperature < 185 ))
|
||||
if(( 75 <= raw_adc_temperature )
|
||||
&& ( raw_adc_temperature <= 184 ))
|
||||
{
|
||||
temp_zone_charge_enable = 1; // 充電許可
|
||||
}
|
||||
else if(( raw_adc_temperature < 70 )
|
||||
|| ( 189 < raw_adc_temperature ))
|
||||
else if(( raw_adc_temperature <= 61 )
|
||||
|| ( 189 <= raw_adc_temperature ))
|
||||
{
|
||||
temp_zone_charge_enable = 0; // 充電禁止
|
||||
}
|
||||
@ -945,7 +946,7 @@ task_status_immed BT_temp_update( )
|
||||
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_GASGAUGE_ERR;
|
||||
}
|
||||
}
|
||||
return ( ERR_SUCCESS );
|
||||
return ( ERR_FINISED );
|
||||
}
|
||||
|
||||
|
||||
@ -960,41 +961,52 @@ void BT_get_left(){
|
||||
u8 temp[2];
|
||||
|
||||
// 電池残量更新 //
|
||||
if( system_status.model == MODEL_TS_BOARD )
|
||||
{
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = 99;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(( vreg_ctr[ VREG_C_STATUS_1 ] & REG_BIT_GASGAUGE_ERR ) == 0 )
|
||||
{
|
||||
temp[0] = iic_mcu_read_a_byte( IIC_SLA_BT_GAUGE, BT_GAUGE_REG_VCELL );
|
||||
if( iic_mcu_bus_status != ERR_SUCCESS )
|
||||
{
|
||||
// バッテリ残量が取れなくなった
|
||||
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_GASGAUGE_ERR;
|
||||
bt_chg_ready = 0;
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( temp[0] < ( 3100 / 16 / 1.25 ) )
|
||||
{
|
||||
// 電圧が規定値になってしまったので強制off
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 電圧はまだ大丈夫、電池残量ICとの通信もOK
|
||||
vreg_ctr[ VREG_C_BT_VOLTAGE ] = temp[0];
|
||||
iic_mcu_read( IIC_SLA_BT_GAUGE, BT_GAUGE_REG_SOC, 2, temp );
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = temp[0];
|
||||
vreg_ctr[ VREG_C_BT_REMAIN_FINE ] = temp[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
// もう特に何もすること無いと思う...
|
||||
}
|
||||
|
||||
#ifdef _debug_bt_irq_
|
||||
if( vreg_ctr[ VREG_C_COMMAND3 ] == 'd' )
|
||||
{
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = vreg_ctr[ VREG_C_DBG01 ];
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if( system_status.model == MODEL_TS_BOARD )
|
||||
{
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = 99;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(( vreg_ctr[ VREG_C_STATUS_1 ] & REG_BIT_GASGAUGE_ERR ) == 0 )
|
||||
{
|
||||
temp[0] = iic_mcu_read_a_byte( IIC_SLA_BT_GAUGE, BT_GAUGE_REG_VCELL );
|
||||
if( iic_mcu_bus_status != ERR_SUCCESS )
|
||||
{
|
||||
// バッテリ残量が取れなくなった
|
||||
vreg_ctr[ VREG_C_STATUS_1 ] |= REG_BIT_GASGAUGE_ERR;
|
||||
bt_chg_ready = 0;
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( temp[0] < ( 3100 / 16 / 1.25 ) )
|
||||
{
|
||||
// 電圧が規定値になってしまったので強制off
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// 電圧はまだ大丈夫、電池残量ICとの通信もOK
|
||||
vreg_ctr[ VREG_C_BT_VOLTAGE ] = temp[0];
|
||||
iic_mcu_read( IIC_SLA_BT_GAUGE, BT_GAUGE_REG_SOC, 2, temp );
|
||||
vreg_ctr[ VREG_C_BT_REMAIN ] = temp[0];
|
||||
vreg_ctr[ VREG_C_BT_REMAIN_FINE ] = temp[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
// もう特に何もすること無いと思う...
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 残量で割り込み。急激に減ると飛ぶことがある //
|
||||
@ -1032,7 +1044,7 @@ static unsigned long bt_relax_timer;
|
||||
**********************************************************/
|
||||
void BT_set_relax_timer()
|
||||
{
|
||||
// RTCを使うと楽かと思ったがそうでもなかった
|
||||
// RTCを使うと楽かと思ったがとんでもなかった
|
||||
bt_relax_timer = (unsigned long)( BT_RELAX_TIME_MIN * 60 * 1000 / SYS_INTERVAL_TICK );
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ enum BT_GAUGE_REG_ADRS
|
||||
};
|
||||
|
||||
|
||||
typedef enum
|
||||
typedef enum BT_VENDER
|
||||
{
|
||||
BT_VENDER_MAXELL = 0, // ショート
|
||||
BT_VENDER_1, // 120
|
||||
|
@ -7,12 +7,13 @@
|
||||
#define VREG_C_FREE_SIZE 200
|
||||
|
||||
// 空いてるメモリ
|
||||
typedef struct {
|
||||
typedef struct _st_vreg_c_ext{
|
||||
unsigned short pedo_log[ PEDOMETER_LOG_SIZE ];
|
||||
unsigned char vreg_c_free[ VREG_C_FREE_SIZE ];
|
||||
}st_vreg_c_ext;
|
||||
|
||||
typedef union{
|
||||
typedef union _uni_pool
|
||||
{
|
||||
st_vreg_c_ext vreg_c_ext;
|
||||
u8 self_update_work[ 256 ]; // 256以上はまとめ書きできない
|
||||
}uni_pool;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "..\config.h"
|
||||
#include "..\user_define.h"
|
||||
|
||||
|
||||
#define _renge_test_
|
||||
|
||||
//******************************************************************************
|
||||
@ -93,9 +94,7 @@ err renge_task_interval_run(){
|
||||
EI();
|
||||
for( i = 0; i != TSK_LAST; i += 1 )
|
||||
{
|
||||
DBG_LED_on;
|
||||
tasks[ i ]();
|
||||
DBG_LED_off;
|
||||
// 逐次起動タスクがあったら起動しておく
|
||||
renge_task_immed_run();
|
||||
}
|
||||
@ -135,7 +134,7 @@ void renge_task_immed_init(){
|
||||
逐次実行タスクの登録
|
||||
割り込み禁止 36us →
|
||||
**************************************/
|
||||
err renge_task_immed_add( task_status* new_task ){
|
||||
err renge_task_immed_add( task_status_immed* new_task ){
|
||||
u8 i;
|
||||
|
||||
// リストの空きの先頭に登録
|
||||
|
@ -10,12 +10,11 @@
|
||||
#include "renge_task_immediate.h"
|
||||
// #include "renge_task_interval_run.h" // 外から強制起動禁止!
|
||||
|
||||
|
||||
//******************************************************************************
|
||||
void renge_init();
|
||||
void renge_task_immed_init();
|
||||
err renge_task_immed_run();
|
||||
err renge_task_immed_add( task_immed );
|
||||
err renge_task_immed_add( task_status_immed* );
|
||||
// static err renge_task_immed_del( u8 );
|
||||
|
||||
void wait_ms( u8 );
|
||||
|
@ -17,9 +17,6 @@ typedef signed char s8;
|
||||
typedef unsigned short u16;
|
||||
typedef signed short s16;
|
||||
|
||||
typedef unsigned char err;
|
||||
|
||||
|
||||
|
||||
// ************************************
|
||||
#define SYS_INTERVAL_TICK 1.953
|
||||
@ -27,14 +24,15 @@ typedef unsigned char err;
|
||||
|
||||
|
||||
// ************************************
|
||||
typedef enum{
|
||||
typedef enum _ERR
|
||||
{
|
||||
ERR_SUCCESS = 0,
|
||||
ERR_ERR,
|
||||
ERR_SYSTEM_OFF
|
||||
}ERR;
|
||||
ERR_ERR
|
||||
}err;
|
||||
|
||||
|
||||
typedef enum{
|
||||
typedef enum _IMMED_TASK_ERR
|
||||
{
|
||||
ERR_FINISED = 0,
|
||||
ERR_CONTINUE
|
||||
}IMMED_TASK_ERR;
|
||||
|
@ -5,7 +5,8 @@
|
||||
|
||||
#include "renge_defs.h"
|
||||
|
||||
enum {
|
||||
enum TSK
|
||||
{
|
||||
TSK_SW, TSK_ADC, TSK_BATT, TSK_LED_POW, TSK_LED_WIFI, TSK_LED_NOTIFY, TSK_LED_CAM, TSK_MISC, TSK_STATUS, TSK_DEBUG, TSK_DEBUG2, TSK_SYS, TSK_LAST
|
||||
};
|
||||
|
||||
|
@ -176,5 +176,7 @@ void rtc_unlock( )
|
||||
======================================================== */
|
||||
__interrupt void int_rtc_int( )
|
||||
{
|
||||
DBG_LED_on;
|
||||
renge_flg_interval += 1; // インクリメント/デクリメント命令を使うので DI()不要
|
||||
DBG_LED_off;
|
||||
}
|
||||
|
@ -11,10 +11,10 @@ extern bit SW_pow_mask;
|
||||
|
||||
#ifdef _FORCE_OFF_1SEC_
|
||||
#define HOLD_THREASHOLD (u8)( 800 / INTERVAL_TSK_SW )
|
||||
#define FORCEOFF_THREASHOLD (u8)( 1200 / INTERVAL_TSK_SW /10 )
|
||||
#define FORCEOFF_THREASHOLD (u8)( 1200 / SYS_INTERVAL_TICK /64 )
|
||||
#else
|
||||
#define HOLD_THREASHOLD (u8)( 2000 / INTERVAL_TSK_SW )
|
||||
#define FORCEOFF_THREASHOLD (u8)( 4000 / INTERVAL_TSK_SW /10 )
|
||||
#define FORCEOFF_THREASHOLD (u8)( 4000 / SYS_INTERVAL_TICK /64 )
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -77,6 +77,12 @@ void tsk_sys( )
|
||||
|
||||
timeout = 0;
|
||||
|
||||
// todo debug
|
||||
#ifdef _debug_bt_irq_
|
||||
vreg_ctr[ VREG_C_DBG01 ] = 63; // todo (‰¼)
|
||||
#endif
|
||||
vreg_ctr[ VREG_C_COMMAND3 ] = 0;
|
||||
|
||||
// “dŒ¹“Š“ü //
|
||||
iic_mcu_start( );
|
||||
BT_chk();
|
||||
@ -448,7 +454,7 @@ static void force_off_check()
|
||||
if( system_status.cnt_force_off != 0 )
|
||||
{
|
||||
system_status.cnt_force_off += 1;
|
||||
if( system_status.cnt_force_off >= ( vreg_ctr[ VREG_C_OFF_DELAY ] * 80 /2 ) )
|
||||
if( system_status.cnt_force_off >= ( vreg_ctr[ VREG_C_OFF_DELAY ] * 64 ) )
|
||||
{
|
||||
system_status.pwr_state = OFF_TRIG;
|
||||
renge_task_interval_run_force = 1;
|
||||
|
@ -41,6 +41,7 @@ extern task_status_immed tski_mcu_info_read();
|
||||
|
||||
// ********************************************************
|
||||
// 非ゼロの初期値の指定が必要なアドレス
|
||||
// マイコンリセット時に呼ばれます
|
||||
void vreg_ctr_init( )
|
||||
{
|
||||
vreg_ctr[ VREG_C_LED_BRIGHT ] = 0xFF;
|
||||
@ -51,6 +52,9 @@ void vreg_ctr_init( )
|
||||
vreg_ctr[ VREG_C_OFF_DELAY ] = FORCEOFF_THREASHOLD;
|
||||
}
|
||||
|
||||
|
||||
// ********************************************************
|
||||
// 本体の電源投入時にセットされます
|
||||
void vreg_ctr_reset( )
|
||||
{
|
||||
#ifdef _PMIC_TWL_
|
||||
|
@ -143,7 +143,7 @@
|
||||
extern u8 vreg_ctr[];
|
||||
|
||||
/*============================================================================*/
|
||||
enum VREG_C
|
||||
enum VREG_C_ADRS
|
||||
{ // 未定義アドレスへ書き込んだ際の動作は不定
|
||||
VREG_C_MCU_VER_MAJOR = 0x00,
|
||||
VREG_C_MCU_VER_MINOR,
|
||||
|
@ -103,7 +103,8 @@ enum REG_TWL_ADRS_INT
|
||||
|
||||
#define REG_TWL_ADRS_MODE__VOL32 ( 1 << 7 )
|
||||
|
||||
typedef enum {
|
||||
typedef enum CAM_LED_TWL_MODE
|
||||
{
|
||||
TWL_CAMLED_OFF,
|
||||
TWL_CAMLED_ON,
|
||||
TWL_CAMLED_BLINK,
|
||||
|
@ -1,23 +1,18 @@
|
||||
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 -qvjl2w -sainter_asm -zpb -no pm.c
|
||||
pm.c(60) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(97) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(181) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(189) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(477) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(480) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(922) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(1019) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
batt_params.h(117) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
batt_params.h(117) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
batt_params.h(122) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
Compilation complete, 0 error(s) and 11 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\pm.asm
|
||||
Assembly complete, 0 error(s) and 0 warning(s) found.
|
||||
"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 -qvjl2w -sainter_asm -zpb -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\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 -qvjl2w -sainter_asm -zpb -no rtc.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\rtc.asm
|
||||
Assembly complete, 0 error(s) and 0 warning(s) found.
|
||||
"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 -qvjl2w -sainter_asm -zpb -no renge\renge.c
|
||||
renge\renge.c(149) : CC78K0R warning W0411: Illegal pointer combination
|
||||
renge\renge.c(157) : CC78K0R warning W0412: Illegal pointer combination in conditional expression
|
||||
Compilation complete, 0 error(s) and 2 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\renge.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
|
||||
@ -28,4 +23,4 @@ intel-HEX to bsr bin converter
|
||||
file converted!
|
||||
|
||||
|
||||
Build Total error(s) : 0 Total warning(s) : 11
|
||||
Build Total error(s) : 0 Total warning(s) : 2
|
||||
|
@ -80,8 +80,8 @@ Kanji=SJIS
|
||||
[Source]
|
||||
Geometry=71, 28, 844, 790
|
||||
Window=Normal
|
||||
DispStart=38
|
||||
CaretPos=77,0
|
||||
DispStart=269
|
||||
CaretPos=319,0
|
||||
Mode=Normal
|
||||
DispFile=
|
||||
Address1=
|
||||
@ -141,9 +141,9 @@ SaveEnd=
|
||||
Accumulative=ON
|
||||
[Assemble]
|
||||
Geometry=282, 92, 968, 626
|
||||
Window=Hide
|
||||
DispStart=864531456
|
||||
CaretPos=0,0
|
||||
Window=Normal
|
||||
DispStart=15201
|
||||
CaretPos=15201,27
|
||||
Address1=
|
||||
Address2=
|
||||
Address3=
|
||||
@ -894,17 +894,7 @@ Manager=ON
|
||||
Sort by=Unsort
|
||||
Detail=OFF
|
||||
Last Name=
|
||||
Name0=bt_ch001
|
||||
Status0=W
|
||||
Access Size0=B
|
||||
Address Range0=EQ
|
||||
Address0=<bt_chg_ready> - <>
|
||||
Mask Address0=00000000
|
||||
Data Range0=NC
|
||||
Data0=<00000000> - <00000000>
|
||||
Mask Data0=FFFFFFFF
|
||||
Pass0=0001
|
||||
Count=1
|
||||
Count=0
|
||||
[Event Link]
|
||||
Geometry=0, 0, 0, 0
|
||||
Window=Hide
|
||||
@ -920,10 +910,7 @@ Manager=ON
|
||||
Sort by=Unsort
|
||||
Detail=OFF
|
||||
Last Name=
|
||||
Name0=bt_ch002
|
||||
Element0=bt_ch001
|
||||
Set0=OFF
|
||||
Count=1
|
||||
Count=0
|
||||
[Trace]
|
||||
Geometry=0, 0, 0, 0
|
||||
Window=Hide
|
||||
@ -1018,31 +1005,7 @@ Line=23
|
||||
Geometry=408, 387, 756, 532
|
||||
Window=Normal
|
||||
Width=150 30 200 100
|
||||
Name0=Swb00002
|
||||
Address0=renge.c#_renge_task_immed_run+0x3d
|
||||
Window0=ASM
|
||||
Status0=ON
|
||||
Name1=Swb00003
|
||||
Address1=renge.c#_renge_task_immed_run+0x11c
|
||||
Window1=ASM
|
||||
Status1=ON
|
||||
Name2=Swb00005
|
||||
Address2=task_sys.c#_force_off_check+0x9
|
||||
Window2=ASM
|
||||
Status2=ON
|
||||
Name3=Swb00001
|
||||
Address3=vreg_ctr.c#_set_irq+0x23
|
||||
Window3=ASM
|
||||
Status3=ON
|
||||
Name4=Swb00007
|
||||
Address4=task_sys.c#_tsk_sys+0x224
|
||||
Window4=ASM
|
||||
Status4=ON
|
||||
Name5=Swb00008
|
||||
Address5=task_sys.c#_tsk_sys+0x21a
|
||||
Window5=ASM
|
||||
Status5=ON
|
||||
Count=6
|
||||
Count=0
|
||||
[Reset]
|
||||
Debugger=ON
|
||||
Symbol=OFF
|
||||
|
@ -4,11 +4,11 @@ FrameX=68
|
||||
FrameY=16
|
||||
FrameCX=1299
|
||||
FrameCY=1044
|
||||
OpenFile1=ProjectWindow
|
||||
PrjPos=0,2,754,3,253
|
||||
OpenFile2=OutputWindow
|
||||
OpenFile1=OutputWindow
|
||||
OutputPos=0,44,989,1000,1587
|
||||
OpenFile3=pm.c,0,176,176,1420,933,0,1036,0,0
|
||||
OpenFile2=pm.c,0,176,176,1420,933,0,1036,0,0
|
||||
OpenFile3=ProjectWindow
|
||||
PrjPos=0,2,754,3,253
|
||||
ActivePRJ=yav_mcu_bsr.prj
|
||||
[ProjectWindow]
|
||||
ProjectWindowDispType=0
|
||||
|
Loading…
Reference in New Issue
Block a user