From b31826e81ccaa3bef755b62918a2b26ddc10e920 Mon Sep 17 00:00:00 2001 From: fujita_ryohei Date: Wed, 31 Mar 2010 09:16:42 +0000 Subject: [PATCH] =?UTF-8?q?TypeT=E3=81=A7=E3=83=90=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=88OFF=E3=82=92=E8=AA=A4=E3=81=A3?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=81=9F=E3=80=82=E3=83=9D=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=AE=E5=90=8D=E5=89=8D=E3=81=AE=E9=96=93=E9=81=95=E3=81=84?= =?UTF-8?q?=20NOP=E3=82=92=E3=81=84=E3=81=8F=E3=81=A4=E3=82=82=E5=85=A5?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=82=92=E9=96=A2?= =?UTF-8?q?=E6=95=B0=E5=8C=96=E3=80=82=E3=82=8F=E3=81=9A=E3=81=8B=E3=81=AB?= =?UTF-8?q?=E3=82=B5=E3=82=A4=E3=82=BA=E3=81=8C=E5=B0=8F=E3=81=95=E3=81=8F?= =?UTF-8?q?=20=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@110 013db118-44a6-b54f-8bf7-843cb86687b1 --- trunk/config.h | 10 +++--- trunk/i2c_mcu.c | 84 +++++++++++++++++++++++++++++++-------------- trunk/pm.c | 3 +- trunk/user_define.h | 4 +-- 4 files changed, 68 insertions(+), 33 deletions(-) diff --git a/trunk/config.h b/trunk/config.h index 985cec1..656cd5a 100644 --- a/trunk/config.h +++ b/trunk/config.h @@ -17,12 +17,12 @@ //#define _PARRADIUM_ //#define _MODEL_TEG2_ - // ↑TEG2 CPU + Type-T + // ↑TEG2 CPU + Type-T //#define _MODEL_WM0_ -//#define _MODEL_TS0_ - // ↑TEG2 CPU + Type-C -#define _MODEL_CTR_TS_ - // ↑FINAL SoC + Type-C +#define _MODEL_TS0_ + // ↑TEG2 CPU + Type-C +//#define _MODEL_CTR_TS_ + // ↑FINAL SoC + Type-C //#define _MODEL_CTR_JIKKI_ diff --git a/trunk/i2c_mcu.c b/trunk/i2c_mcu.c index df7e302..fe45b74 100644 --- a/trunk/i2c_mcu.c +++ b/trunk/i2c_mcu.c @@ -72,6 +72,10 @@ u8 iic_send_wo_dma_len; u8 iic_mcu_bus_status; // 一文字リードの時はデータを返す。 // ステータスが必要ならこっちを呼んで +void nop8() +{ +} + /* ======================================================== @@ -401,7 +405,9 @@ __interrupt void int_dma1( ) ST0 = 0x0004; SOE0 = 0; // 受信の時はもっと前に「も」設定してる。(NACK出力) SO0 = 0x0000 | TAUS_MASK; // SCL - NOP( ); + nop8(); +/* + NOP( ); NOP( ); NOP( ); NOP( ); @@ -412,7 +418,10 @@ __interrupt void int_dma1( ) NOP( ); NOP( ); #endif +*/ SO0 = 0x0400 | TAUS_MASK; // SCL + nop8(); +/* NOP( ); NOP( ); NOP( ); @@ -424,6 +433,7 @@ __interrupt void int_dma1( ) NOP( ); NOP( ); #endif +*/ SO0 = 0x0404 | TAUS_MASK; } IICMK10 = 1; @@ -456,6 +466,8 @@ __interrupt void int_iic10( ) ST0 = 0x0004; SOE0 = 0; // 受信の時はもっと前に「も」設定してる。(NACK出力) SO0 = 0x0000 | TAUS_MASK; // SCL + nop8(); +/* NOP( ); NOP( ); NOP( ); @@ -467,7 +479,10 @@ __interrupt void int_iic10( ) NOP( ); NOP( ); #endif +*/ SO0 = 0x0400 | TAUS_MASK; // SCL + nop8(); +/* NOP( ); NOP( ); NOP( ); @@ -479,6 +494,7 @@ __interrupt void int_iic10( ) NOP( ); NOP( ); #endif +*/ SO0 = 0x0404 | TAUS_MASK; } iic_mcu_wo_dma = 0; @@ -539,10 +555,12 @@ static err iic_mcu_send_a_byte( u8 dat ) static void iic_mcu_send_st( ) { SO0 &= ~0x0004; // SDA - NOP( ); - NOP( ); - NOP( ); - NOP( ); + nop8(); +/* + NOP( ); + NOP( ); + NOP( ); + NOP( ); #ifdef _OVERCLOCK_ NOP( ); NOP( ); @@ -550,6 +568,7 @@ static void iic_mcu_send_st( ) NOP( ); NOP( ); #endif +*/ SO0 &= ~0x0400; // SCL SOE0 = 0x0004; // ハード制御へ @@ -566,10 +585,12 @@ static void iic_mcu_send_re_st( ) { ST0 |= 0x0004; SO0 |= 0x0400 | TAUS_MASK; // ( SDA = H ), SCL -> H - NOP( ); - NOP( ); - NOP( ); - NOP( ); + nop8(); +/* + NOP( ); + NOP( ); + NOP( ); + NOP( ); #ifdef _OVERCLOCK_ NOP( ); NOP( ); @@ -577,11 +598,14 @@ static void iic_mcu_send_re_st( ) NOP( ); NOP( ); #endif +*/ SOE0 &= ~0x0004; // ( SCL = H ), SDA -> L - NOP( ); - NOP( ); - NOP( ); - NOP( ); + nop8(); +/* + NOP( ); + NOP( ); + NOP( ); + NOP( ); #ifdef _OVERCLOCK_ NOP( ); NOP( ); @@ -589,6 +613,7 @@ static void iic_mcu_send_re_st( ) NOP( ); NOP( ); #endif +*/ iic_mcu_send_st( ); } @@ -603,10 +628,12 @@ static void iic_mcu_send_sp( ) ST0 = 0x0004; SOE0 = 0; // 受信の時はもっと前に「も」設定してる。(NACK出力) SO0 = 0x0000 | TAUS_MASK; // SCL - NOP( ); - NOP( ); - NOP( ); - NOP( ); + nop8(); +/* + NOP( ); + NOP( ); + NOP( ); + NOP( ); #ifdef _OVERCLOCK_ NOP( ); NOP( ); @@ -614,11 +641,14 @@ static void iic_mcu_send_sp( ) NOP( ); NOP( ); #endif +*/ SO0 = 0x0400 | TAUS_MASK; // SCL - NOP( ); - NOP( ); - NOP( ); - NOP( ); + nop8(); +/* + NOP( ); + NOP( ); + NOP( ); + NOP( ); #ifdef _OVERCLOCK_ NOP( ); NOP( ); @@ -626,6 +656,7 @@ static void iic_mcu_send_sp( ) NOP( ); NOP( ); #endif +*/ SO0 = 0x0404 | TAUS_MASK; } @@ -643,10 +674,12 @@ void iic_mcu_start( ) DEN1 = 0; I2C_PU = 1; SAU0EN = 1; - NOP( ); // 4clkあける - NOP( ); - NOP( ); - NOP( ); + nop8(); +/* + NOP( ); + NOP( ); + NOP( ); + NOP( ); #ifdef _OVERCLOCK_ NOP( ); NOP( ); @@ -654,6 +687,7 @@ void iic_mcu_start( ) NOP( ); NOP( ); #endif +*/ SPS0 = 0x0000; // シリアルユニットのクロック0。(8M/2)/1 SMR02 = bSMR0n_FIXEDBIT | bMD0n2; // 簡易I2Cに設定 #ifdef _OVERCLOCK_ diff --git a/trunk/pm.c b/trunk/pm.c index 357bcf5..d8be15b 100644 --- a/trunk/pm.c +++ b/trunk/pm.c @@ -217,6 +217,7 @@ u8 blset; 起動失敗であれば電源が落ちる 別のタスクで電源落ちは監視していて、ステータスもクリアする ======================================================== */ +// BSR // err PM_LCD_on( ) { u8 rv; @@ -254,7 +255,7 @@ err PM_LCD_on( ) return ( rv ); } - +// BSR // void PM_LCD_off() { SND_DEPOP_ACT; diff --git a/trunk/user_define.h b/trunk/user_define.h index 1a689be..7bb5a5b 100644 --- a/trunk/user_define.h +++ b/trunk/user_define.h @@ -119,8 +119,8 @@ // INTP6 #ifndef _MODEL_CTR_ -#define SND_DEPOP_ACT P7.5 = 1 -#define SND_DEPOP_DEACT P7.5 = 0 +#define SND_DEPOP_ACT P7.6 = 1 +#define SND_DEPOP_DEACT P7.6 = 0 #else #define SND_DEPOP_ACT ; #define SND_DEPOP_DEACT ;