mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-10-31 13:51:10 -04:00
歩数計デバッグ用にIIC2レジスタにデータを吐くようにした
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@94 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
parent
31281f00dd
commit
d88fef1e83
@ -149,7 +149,28 @@ task_status_immed tsk_cbk_accero( )
|
||||
{
|
||||
time_l += ( time_l != 65535 ) ? 1: 0;
|
||||
}
|
||||
|
||||
{
|
||||
static u8 i = 0;
|
||||
|
||||
vreg_ctr[VREG_C_ACC_DBG_0] = i;
|
||||
|
||||
vreg_ctr[VREG_C_ACC_DBG_1] = (u8)( acc_norm[0] / 256 & 0x00FF );
|
||||
vreg_ctr[VREG_C_ACC_DBG_2] = (u8)( acc_norm[0] & 0x00FF );
|
||||
|
||||
vreg_ctr[VREG_C_ACC_DBG_3] = (u8)( interval_hh / 256 & 0x00FF );
|
||||
vreg_ctr[VREG_C_ACC_DBG_4] = (u8)( interval_hh & 0x00FF );
|
||||
|
||||
vreg_ctr[VREG_C_ACC_DBG_5] = (u8)( time_l / 256 & 0x00FF );
|
||||
vreg_ctr[VREG_C_ACC_DBG_6] = (u8)( time_l & 0x00FF );
|
||||
|
||||
vreg_ctr[VREG_C_ACC_DBG_7] = vreg_ctr[ VREG_C_ACC_HOSU_L ];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ( ERR_SUCCESS );
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
#define __config__
|
||||
|
||||
#define _debug_
|
||||
// #define _debug_led_
|
||||
//#define _debug_led_
|
||||
|
||||
|
||||
#define MCU_VER_MAJOR 0x00
|
||||
|
||||
@ -68,7 +68,6 @@ __interrupt void int_iic_ctr( )
|
||||
static u8 reg_adrs_internal;
|
||||
static u8 tx_buf;
|
||||
u8 rx_buf;
|
||||
u8 tx_buf_temp;
|
||||
|
||||
EI();
|
||||
|
||||
@ -168,7 +167,7 @@ __interrupt void int_iic_ctr( )
|
||||
default: // バースト R/W でここが何回も呼ばれることになる
|
||||
if( state == IIC_TX )
|
||||
{ // 送信
|
||||
// IICA = tx_buf;
|
||||
IICA = tx_buf;
|
||||
vreg_ctr_after_read( reg_adrs ); // 読んだらクリアなどの処理
|
||||
}
|
||||
else
|
||||
@ -184,9 +183,7 @@ __interrupt void int_iic_ctr( )
|
||||
|
||||
if( state == IIC_TX )
|
||||
{ // さらにつぎに送るデータの準備だけシテオク。SPが来て使われないかもしれない
|
||||
tx_buf_temp = vreg_ctr_read( reg_adrs );
|
||||
IICA = tx_buf;
|
||||
tx_buf = tx_buf_temp;
|
||||
tx_buf = vreg_ctr_read( reg_adrs );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -95,13 +95,13 @@ __interrupt void int_iic_twl( )
|
||||
}
|
||||
*/
|
||||
WREL = 1; // ウェイト解除して次のバイトを待つ
|
||||
|
||||
wait_next; // 1バイト受信完了を待つ
|
||||
|
||||
// 2回目 R/W レジスタアドレス
|
||||
temp = IICA;
|
||||
WREL = 1;
|
||||
IICAIF = 0;
|
||||
WREL = 1;
|
||||
|
||||
vreg_adrs = adrs_table_twl_ext2int( temp );
|
||||
|
||||
// 3回目
|
||||
|
||||
@ -503,13 +503,13 @@ err PM_sys_pow_on( )
|
||||
PM_reset_neg();
|
||||
RESET2_neg;
|
||||
FCRAM_RST_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;
|
||||
@ -531,7 +531,6 @@ err PM_sys_pow_on( )
|
||||
return ( ERR_ERR );
|
||||
}
|
||||
vreg_ctr[VREG_C_BT_REMAIN] = temp;
|
||||
|
||||
PM_reset_neg();
|
||||
RESET2_neg;
|
||||
FCRAM_RST_neg;
|
||||
@ -544,11 +543,12 @@ err PM_sys_pow_on( )
|
||||
FCRAM_RST_ast;
|
||||
return ( ERR_ERR );
|
||||
}
|
||||
/*
|
||||
{ // CODEC 不定レジスタ初期化
|
||||
u8 codec_reg_init[3] = { 0,0,0 };
|
||||
iic_mcu_write( IIC_SLA_CODEC, CODEC_REG_PM, 3, codec_reg_init );
|
||||
}
|
||||
|
||||
*/
|
||||
#endif
|
||||
|
||||
return ( ERR_SUCCESS );
|
||||
|
||||
@ -70,7 +70,6 @@ void RTC_init( void )
|
||||
======================================================== */
|
||||
__interrupt void int_rtc( )
|
||||
{
|
||||
EI();
|
||||
// 日付も指定日で
|
||||
if( ( vreg_ctr[VREG_C_RTC_ALARM_DAY] == DAY )
|
||||
&& ( vreg_ctr[VREG_C_RTC_ALARM_MONTH] == MONTH )
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
|
||||
|
||||
void RTC_init( void );
|
||||
__interrupt void int_rtc_int( );
|
||||
void rtc_buf_reflesh( );
|
||||
void set_rtc( );
|
||||
|
||||
|
||||
@ -148,13 +148,14 @@ task_status_immed do_command0( )
|
||||
FCRAM_RST_neg;
|
||||
RESET2_neg;
|
||||
PM_reset_neg();
|
||||
|
||||
/*
|
||||
// CODEC 不定レジスタ初期化
|
||||
wait_ms( 100 );
|
||||
{
|
||||
u8 codec_reg_init[3] = { 0,0,0 };
|
||||
iic_mcu_write( IIC_SLA_CODEC, CODEC_REG_PM, 3, codec_reg_init );
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -27,10 +27,8 @@
|
||||
#define DBG_LED_WIFI_2_toggle ( P2.4 ^= 1 )
|
||||
|
||||
#else
|
||||
#define DBG_LED_WIFI_on ;
|
||||
#define DBG_LED_WIFI_2_on ;
|
||||
#define DBG_LED_WIFI_2_off ;
|
||||
#define DBG_LED_WIFI_off ;
|
||||
#define DBG_LED_WIFI_2_toggle ;
|
||||
#endif
|
||||
|
||||
|
||||
@ -231,6 +231,25 @@ enum VREG_C
|
||||
|
||||
// VREG_C_AMBIENT_BRIGHTNESS = 0x60,
|
||||
|
||||
// 歩数計の評価のため...
|
||||
VREG_C_ACC_DBG_0 = 0x50,
|
||||
VREG_C_ACC_DBG_1,
|
||||
VREG_C_ACC_DBG_2,
|
||||
VREG_C_ACC_DBG_3,
|
||||
VREG_C_ACC_DBG_4,
|
||||
VREG_C_ACC_DBG_5,
|
||||
VREG_C_ACC_DBG_6,
|
||||
VREG_C_ACC_DBG_7,
|
||||
VREG_C_ACC_DBG_8,
|
||||
VREG_C_ACC_DBG_9,
|
||||
VREG_C_ACC_DBG_A,
|
||||
VREG_C_ACC_DBG_B,
|
||||
VREG_C_ACC_DBG_C,
|
||||
VREG_C_ACC_DBG_D,
|
||||
VREG_C_ACC_DBG_E,
|
||||
VREG_C_ACC_DBG_F,
|
||||
|
||||
|
||||
VREG_C_ENDMARK_
|
||||
};
|
||||
/*
|
||||
@ -245,5 +264,4 @@ u8 vreg_ctr_read( u8 phy_adrs );
|
||||
void vreg_ctr_after_read( u8 adrs );
|
||||
void set_irq( u8 irqreg, u8 irq_flg );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@ -118,4 +118,12 @@ u8 vreg_twl_read( u8 phy_adrs );
|
||||
|
||||
task_status_immed command_from_twl( );
|
||||
|
||||
|
||||
// 読んだらクリアなどの処理
|
||||
#define vreg_twl_after_read( reg_adrs ); \
|
||||
if( reg_adrs == REG_TWL_INT_ADRS_IRQ ) \
|
||||
{ \
|
||||
vreg_twl[ REG_TWL_INT_ADRS_IRQ ]= 0;\
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,13 +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 -quvjl3wt -sainter_asm -zp -no loader.c
|
||||
loader.c(111) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
Compilation complete, 0 error(s) and 1 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\loader.asm
|
||||
"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 -quvjl3wt -sainter_asm -zp -no pm.c
|
||||
pm.c(167) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(178) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(182) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(233) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(270) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(349) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(357) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
pm.c(839) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
Compilation complete, 0 error(s) and 8 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 -quvjl3wt -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\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 -quvjl3wt -sainter_asm -zp -no task_misc.c
|
||||
task_misc.c(48) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
task_misc.c(34) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
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\task_misc.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 -kp -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
|
||||
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
|
||||
@ -18,4 +31,4 @@ intel-HEX to bsr bin converter
|
||||
file converted!
|
||||
|
||||
|
||||
Build Total error(s) : 0 Total warning(s) : 1
|
||||
Build Total error(s) : 0 Total warning(s) : 10
|
||||
|
||||
Loading…
Reference in New Issue
Block a user