TypeTでバックライトOFFを誤っていた。ポートの名前の間違い

NOPをいくつも入れていたのを関数化。わずかにサイズが小さく
コメント追加

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
This commit is contained in:
fujita_ryohei 2010-03-31 09:16:42 +00:00
parent 559fe96298
commit b31826e81c
4 changed files with 68 additions and 33 deletions

View File

@ -17,12 +17,12 @@
//#define _PARRADIUM_
//#define _MODEL_TEG2_
// <20>ªTEG2 CPU <20>{ Type-T
// <20>ªTEG2 CPU <20>{ Type-T
//#define _MODEL_WM0_
//#define _MODEL_TS0_
// <20>ªTEG2 CPU <20>{ Type-C
#define _MODEL_CTR_TS_
// <20>ªFINAL SoC <20>{ Type-C
#define _MODEL_TS0_
// <20>ªTEG2 CPU <20>{ Type-C
//#define _MODEL_CTR_TS_
// <20>ªFINAL SoC <20>{ Type-C
//#define _MODEL_CTR_JIKKI_

View File

@ -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_

View File

@ -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;

View File

@ -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 ;