mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-10-31 13:51:10 -04:00
0B
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@43 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
parent
a563ecdd66
commit
282ee86c5f
@ -124,6 +124,7 @@ void tsk_adc( )
|
||||
|
||||
adc_updated = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ADCEN = 1;
|
||||
@ -137,7 +138,6 @@ void tsk_adc( )
|
||||
ADIF = 0;
|
||||
ADMK = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ MERGE @@CNST: =ROM
|
||||
MERGE @@R_INIT: =ROM
|
||||
|
||||
|
||||
|
||||
; 謹製フラッシュライブラリ
|
||||
; MERGE FSL_CODE:=FSL
|
||||
MERGE FSL_CODE:=BCL0
|
||||
@ -50,3 +51,5 @@ memory RAM2 : (0FFE20H, 00C0H) ;
|
||||
;memory SLF_RAM : (0FFE00H, 0020H) ; Slef Program予約領域[使用禁止]
|
||||
memory RAM : (0FF900H, 0500H) ; ユーザーRAM領域
|
||||
;memory SLF_RAM : (0FF900H, 0020H) ; Slef Program予約領域[使用禁止]
|
||||
|
||||
|
||||
|
||||
@ -21,6 +21,8 @@
|
||||
|
||||
//#define _SW_HOME_ENABLE_
|
||||
|
||||
//#define _SAITO_
|
||||
|
||||
// ---------------------------------- //
|
||||
|
||||
#ifdef _MODEL_TEG2_
|
||||
|
||||
@ -161,7 +161,9 @@ void hdwinit( void )
|
||||
|
||||
CMC = 0b00010110; /* X1発振せず(入力ポート)、XT1使用、推奨の推奨で超低電力発振 */
|
||||
CSC = 0b10000000; /* X1発振なし、XT1発振あり、高速内蔵発振動作 */
|
||||
// OSMC = 0x00; /* フラッシュ・メモリの高速動作用昇圧回路 */
|
||||
#ifdef _MCU_BSR_
|
||||
OSMC = 0x01; /* 隠しレジスタ */
|
||||
#endif
|
||||
#ifdef _OVERCLOCK_
|
||||
CKC = 0b00001000; /* CPU/周辺クロック=fMAIN、fMAIN=fMX、fCLK=fMX */
|
||||
#else
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#include "pm.h"
|
||||
#include "accero.h"
|
||||
#include "led.h"
|
||||
|
||||
#include "adc.h"
|
||||
|
||||
|
||||
// ========================================================
|
||||
|
||||
@ -540,10 +540,11 @@ err PM_sys_pow_on( )
|
||||
PM_VDD50A_on( ); // 液晶電源ではなく、ledとかに使うものです
|
||||
|
||||
wait_ms( DELAY_PM_TW_PWUP );
|
||||
|
||||
PM_VDD_normMode();
|
||||
#ifdef _PM_BUG_
|
||||
iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x03 ); // バグ持ちPMIC対策 強制PWM
|
||||
#endif
|
||||
|
||||
if( PM_chk_LDSW( ) == 0 )
|
||||
{
|
||||
return ( ERR_ERR );
|
||||
|
||||
21
trunk/pm.h
21
trunk/pm.h
@ -119,14 +119,29 @@ task_status_immed tski_vcom_set( );
|
||||
#define PM_off() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_VDD_SYS, 0 ))
|
||||
|
||||
#ifdef _model_CTR_
|
||||
#define PM_VDD_ecoMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x47 ))
|
||||
#define PM_VDD_ecoMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x27 ))
|
||||
#define PM_VDD_normMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 ))
|
||||
// todo コア電圧を下げる
|
||||
|
||||
#else
|
||||
#define PM_VDD_ecoMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 | 0x40 ))
|
||||
// –{”Ôƒ`ƒbƒv‘Ò‚¿
|
||||
#ifdef _PM_BUG_
|
||||
#define PM_VDD_ecoMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 | 0x04 ))
|
||||
#define PM_VDD_normMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 | 0x03 ))
|
||||
|
||||
#else
|
||||
|
||||
#ifdef _SAITO_
|
||||
#define PM_VDD_ecoMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 | 0x04 ))
|
||||
#else
|
||||
|
||||
#define PM_VDD_ecoMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 | 0x07 ))
|
||||
#endif
|
||||
|
||||
#define PM_VDD_normMode() ( iic_mcu_write_a_byte( IIC_SLA_PMIC, PM_REG_ADRS_POW_SAVE, 0x00 | 0x00 ))
|
||||
|
||||
#endif
|
||||
#endif
|
||||
// ↑本番チップ待ち+PMICバグ
|
||||
|
||||
// ほか //
|
||||
#ifdef _PMIC_TWL_
|
||||
|
||||
@ -22,7 +22,7 @@ bit rtc_alarm_dirty;
|
||||
void RTC_init( void )
|
||||
{
|
||||
|
||||
if( !RTCEN )
|
||||
if( !RTCEN ) // ビットが立っていたらリブート
|
||||
{
|
||||
RTCEN = 1; // モジュールON
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ void tsk_sys( )
|
||||
break;
|
||||
|
||||
case SLEEP_TRIG: //-------------------------------------
|
||||
// PM_VDD_ecoMode();
|
||||
PM_VDD_ecoMode();
|
||||
system_status.pwr_state = SLEEP;
|
||||
break;
|
||||
|
||||
@ -161,7 +161,7 @@ void tsk_sys( )
|
||||
chk_emergencyExit();
|
||||
// スリープから復帰
|
||||
if( !SLP_REQ ){
|
||||
// PM_VDD_normMode();
|
||||
PM_VDD_normMode();
|
||||
wait_ms( 5 ); // tdly_sw
|
||||
|
||||
#ifdef _MODEL_CTR_
|
||||
@ -254,7 +254,17 @@ void tsk_sys( )
|
||||
// 割り込み待ちで寝る //
|
||||
RTCIMK = 1;
|
||||
#ifndef _PARRADIUM_
|
||||
|
||||
#ifdef _MCU_BSR_
|
||||
CKC = 0b00001001;
|
||||
OSMC = 0x00;
|
||||
#endif
|
||||
STOP( );
|
||||
#ifdef _MCU_BSR_
|
||||
OSMC = 0x01;
|
||||
CKC = 0b00001000;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
RTCIMK = 0;
|
||||
// 起きる //
|
||||
@ -263,7 +273,7 @@ void tsk_sys( )
|
||||
// ・KeyReturn割り込み(電源ボたん)
|
||||
// ・RTCアラーム
|
||||
// ・アダプタ挿抜
|
||||
system_status.pwr_state = OFF; //
|
||||
system_status.pwr_state = OFF; //
|
||||
renge_task_interval_run_force = 1;
|
||||
KRMK = 1;
|
||||
return;
|
||||
@ -338,4 +348,4 @@ __interrupt void intp0_slp( )
|
||||
**********************************************************/
|
||||
task_status_immed tski_firm_update(){
|
||||
firm_update();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,12 @@
|
||||
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 -quvjl2wt -sainter_asm -zp -no loader.c
|
||||
loader.c(106) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
loader.c(110) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
loader.c(113) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
Compilation complete, 0 error(s) and 3 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
|
||||
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 -quvjl2wt -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 -quvjl2wt -sainter_asm -zp -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\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 -gb6EFBFFh -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
|
||||
@ -17,4 +14,4 @@ Object Conversion Complete, 0 error(s) and 0 warning(s) found.
|
||||
C:\WINDOWS\system32\cmd.exe /c ruby C:\Cygwin\home\fujita_ryohei\ctr\nec_s_2_bsrbin.rb bsr.hex
|
||||
C:/Cygwin/home/fujita_ryohei/ctr/nec_s_2_bsrbin.rb:2: warning: variable $KCODE is no longer effective; ignored
|
||||
|
||||
Build Total error(s) : 0 Total warning(s) : 3
|
||||
Build Total error(s) : 0 Total warning(s) : 0
|
||||
|
||||
@ -80,8 +80,8 @@ Kanji=SJIS
|
||||
[Source]
|
||||
Geometry=294, 80, 600, 1014
|
||||
Window=Normal
|
||||
DispStart=53
|
||||
CaretPos=109,0
|
||||
DispStart=263
|
||||
CaretPos=264,0
|
||||
Mode=Normal
|
||||
DispFile=
|
||||
Address1=
|
||||
@ -142,16 +142,16 @@ Accumulative=ON
|
||||
[Source1]
|
||||
Geometry=25, 25, 600, 1014
|
||||
Window=Normal
|
||||
DispStart=780
|
||||
CaretPos=789,5
|
||||
DispStart=777
|
||||
CaretPos=778,0
|
||||
Mode=Normal
|
||||
DispFile=pm.c
|
||||
Accumulative=ON
|
||||
[Assemble]
|
||||
Geometry=605, 2, 600, 400
|
||||
Window=Normal
|
||||
DispStart=10264
|
||||
CaretPos=10264,27
|
||||
DispStart=16108
|
||||
CaretPos=16108,27
|
||||
Address1=
|
||||
Address2=
|
||||
Address3=
|
||||
@ -202,7 +202,7 @@ Endian=Little
|
||||
Ascii=OFF
|
||||
Idtag=OFF
|
||||
Address=
|
||||
DispStart=00000F60
|
||||
DispStart=00000000
|
||||
CaretPosData=0, 246
|
||||
CaretPosAscii=0, 246
|
||||
Address1=
|
||||
|
||||
@ -5,11 +5,11 @@ FrameY=51
|
||||
FrameCX=1299
|
||||
FrameCY=1043
|
||||
OpenFile1=accero.c,0,272,165,1516,922,26,119,26,0
|
||||
OpenFile2=ProjectWindow
|
||||
OpenFile2=sw.c,0,132,132,1376,889,54,121,54,0
|
||||
OpenFile3=loader.c,0,266,31,1510,788,17,88,17,0
|
||||
OpenFile4=ProjectWindow
|
||||
PrjPos=0,2,754,3,253
|
||||
OpenFile3=sw.c,0,132,132,1376,889,54,121,54,0
|
||||
OpenFile4=config.h,0,286,286,1530,1043,0,23,21,0
|
||||
OpenFile5=loader.c,0,154,154,1398,911,4,107,0,0
|
||||
OpenFile5=config.h,0,286,286,1530,1043,0,19,20,0
|
||||
OpenFile6=OutputWindow
|
||||
OutputPos=0,48,992,426,1226
|
||||
ActivePRJ=yav_mcu_bsr.prj
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[SdbInfo]
|
||||
Ver=5
|
||||
[loader.c]
|
||||
T=4b1cefc9
|
||||
T=4b1efd24
|
||||
1=incs_loader.h
|
||||
2=fsl.h
|
||||
3=fsl_user.h
|
||||
@ -11,7 +11,7 @@ T=4b1cefc9
|
||||
7=rtc.h
|
||||
8=reboot.h
|
||||
[pm.c]
|
||||
T=4b1ce7a6
|
||||
T=4b1e0cfa
|
||||
1=incs.h
|
||||
2=adc.h
|
||||
3=led.h
|
||||
@ -20,15 +20,16 @@ T=4b1ce7a6
|
||||
T=4b024862
|
||||
1=incs.h
|
||||
[main.c]
|
||||
T=4b1ceddb
|
||||
T=4b1e0c63
|
||||
1=incs.h
|
||||
2=WDT.h
|
||||
3=rtc.h
|
||||
4=pm.h
|
||||
5=accero.h
|
||||
6=led.h
|
||||
7=adc.h
|
||||
[magic.c]
|
||||
T=4b1ceee0
|
||||
T=4b1efde0
|
||||
1=config.h
|
||||
[WDT.c]
|
||||
T=4afd21ca
|
||||
@ -115,7 +116,7 @@ T=4b0b8f86
|
||||
3=pm.h
|
||||
4=accero.h
|
||||
[task_sys.c]
|
||||
T=4b1c9f49
|
||||
T=4b1efdd2
|
||||
1=incs.h
|
||||
2=i2c_twl.h
|
||||
3=i2c_ctr.h
|
||||
@ -141,7 +142,7 @@ T=4b023fdb
|
||||
T=4b1cdaa0
|
||||
1=config.h
|
||||
[config.h]
|
||||
T=4b1cea92
|
||||
T=4b1f0b1f
|
||||
[bsr_system.h]
|
||||
T=4afd21ca
|
||||
[renge\renge.h]
|
||||
@ -170,7 +171,7 @@ T=4afd21cb
|
||||
[i2c_ctr.h]
|
||||
T=4afd21cb
|
||||
[pm.h]
|
||||
T=4b1c45a0
|
||||
T=4b1efd58
|
||||
[rtc.h]
|
||||
T=4b161be1
|
||||
[adc.h]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user