歩数計ログ読み出し時の、カレンダ情報変更

hh -> hh dd mm yy


git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@83 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
fujita_ryohei 2010-01-22 02:03:45 +00:00
parent 80a2258f25
commit 6cd9cf5bf1
4 changed files with 121 additions and 88 deletions

View File

@ -162,11 +162,13 @@ task_status_immed tsk_cbk_accero( )
========================================================*/ ========================================================*/
u8 p_record; u8 p_record;
u8 last_hour; // 履歴の最新は何時? u8 last_hour; // 履歴の最新は何時?
u8 last_day;
u8 last_month;
u8 last_year;
static void hosu_increment() static void hosu_increment()
{ {
static u16 last_hour_fny; static u16 last_hour_fny;
static u8 last_year;
// 累積の更新 // // 累積の更新 //
// いろいろ失敗した... // いろいろ失敗した...
@ -193,7 +195,10 @@ static void hosu_increment()
RWAIT = 1; RWAIT = 1;
while( !RWST ){;} while( !RWST ){;}
now_year = bcdtob( YEAR ); now_year = bcdtob( YEAR );
last_hour = HOUR; // 履歴読み出し時に使用。BCDのままでよい last_hour = HOUR; // 履歴読み出し時に使用。BCDのままでよい
last_day = DAY;
last_month = MONTH;
last_year = YEAR;
now_hour = get_long_hour(); now_hour = get_long_hour();
// RWAIT = 0; ↑で行っています // RWAIT = 0; ↑で行っています
// EI(); 〃 // EI(); 〃
@ -256,7 +261,7 @@ void fill_hosu_hist_hours( u16 hours )
} }
bit hosu_read_inited; u8 hosu_read_state;
bit record_read_msb_lsb; bit record_read_msb_lsb;
/* ======================================================== /* ========================================================
@ -266,7 +271,7 @@ bit record_read_msb_lsb;
void hosu_read_end( ) void hosu_read_end( )
{ {
record_read_msb_lsb = 0; record_read_msb_lsb = 0;
hosu_read_inited = 0; hosu_read_state = 0;
} }
@ -280,30 +285,51 @@ u8 hosu_read( )
u16 temp; u16 temp;
static u8 p_record_buffer; static u8 p_record_buffer;
if( hosu_read_inited == 0 ) switch( hosu_read_state ){
{ case( 0 ):
p_record_buffer = p_record; p_record_buffer = p_record;
hosu_read_inited = 1; hosu_read_state += 1;
return( last_hour ); // 最初は、最後に記録した時刻を送る return( last_hour );
}
temp = pool[ p_record_buffer ]; case( 1 ):
if( record_read_msb_lsb == 0 ) hosu_read_state += 1;
{ return( last_day );
dat = (u8)( ( temp & 0xFF00 ) >> 8 );
case( 2 ):
hosu_read_state += 1;
return( last_month );
case( 3 ):
hosu_read_state += 1;
return( last_year );
case( 4 ):
hosu_read_state += 1;
return( 0x55 ); // reserved dummy
case( 5 ):
hosu_read_state += 1;
return( 0xAA ); // reserved. dummy
default:
temp = pool[ p_record_buffer ];
if( record_read_msb_lsb == 0 )
{
dat = (u8)(( temp >> 8 ) & 0x00FF );
}
else
{
dat = (u8)( temp & 0x00FF );
p_record_buffer -= 1;
}
record_read_msb_lsb += 1;
return( dat );
} }
else
{
dat = (u8)( temp & 0x00FF );
p_record_buffer -= 1;
}
record_read_msb_lsb += 1;
return( dat );
} }
/*========================================================= /*=======================================================
     
========================================================*/ ========================================================*/
task_status_immed acc_read( ) task_status_immed acc_read( )

View File

@ -4,7 +4,7 @@ Target=IDK0R32G
[Configuration] [Configuration]
Chip=uPD79F0104 Chip=uPD79F0104
Internal Rom=32KB Internal Rom=32KB
Internal Ram=1536KB Internal Ram=1536B
Clock=Target Clock=Target
Sub Clock=Target Sub Clock=Target
Peripheral Break=0x2 Peripheral Break=0x2
@ -22,8 +22,8 @@ SubClock=None
[Mapping] [Mapping]
Count=0 Count=0
[Main] [Main]
Geometry=66, 66, 1467, 1110 Geometry=25, 22, 1467, 1110
Window=Max Window=Normal
MDI_MAX=OFF MDI_MAX=OFF
Button=ON Button=ON
Mode=Auto Mode=Auto
@ -78,10 +78,10 @@ Symbol Type=OFF
Language=C Language=C
Kanji=SJIS Kanji=SJIS
[Source] [Source]
Geometry=133, 46, 1012, 623 Geometry=274, 329, 1012, 623
Window=Normal Window=Normal
DispStart=331 DispStart=209
CaretPos=350,0 CaretPos=210,0
Mode=Normal Mode=Normal
DispFile= DispFile=
Address1= Address1=
@ -140,18 +140,18 @@ SaveStart=
SaveEnd= SaveEnd=
Accumulative=ON Accumulative=ON
[Source1] [Source1]
Geometry=0, 0, 1025, 1014 Geometry=50, 50, 1019, 857
Window=Normal Window=Normal
DispStart=289 DispStart=37
CaretPos=1,0 CaretPos=53,11
Mode=Normal Mode=Normal
DispFile=self_flash.c DispFile=accero.c
Accumulative=ON Accumulative=ON
[Assemble] [Assemble]
Geometry=605, 2, 600, 400 Geometry=605, 2, 600, 400
Window=Normal Window=Normal
DispStart=1096 DispStart=14015
CaretPos=876,27 CaretPos=14015,27
Address1= Address1=
Address2= Address2=
Address3= Address3=
@ -203,8 +203,8 @@ Ascii=OFF
Idtag=OFF Idtag=OFF
Address= Address=
DispStart=00007C20 DispStart=00007C20
CaretPosData=50, 1998 CaretPosData=0, 1986
CaretPosAscii=39804, 2499945215 CaretPosAscii=0, 1986
Address1= Address1=
Address2= Address2=
Address3= Address3=
@ -866,57 +866,71 @@ Count=0
Geometry=1225, 6, 354, 910 Geometry=1225, 6, 354, 910
Window=Normal Window=Normal
Boundary=13762700 Boundary=13762700
0=.vreg_ctr,P,N,A,+,1 0=+pool,P,N,A,-,1
1=.cmd_BL,P,N,A,+,1 1=.new_task,.,N,A,+,1
2=.P7,B,S,A,+,1 2=.vreg_ctr,P,N,A,+,1
3=.p5,B,S,A,+,1 3=.cmd_BL,P,N,A,+,1
Line=4 4=.P7,B,S,A,+,1
5=.p5,B,S,A,+,1
Line=6
[Quick Watch] [Quick Watch]
0=renge_flg_interval,P,A,1 0=rtciimk,P,A,1
1=rtccmk,P,A,1 1=wdte,P,A,1
2=rtciimk,P,A,1 2=SEC,P,A,1
3=wdte,P,A,1 3=rtcif,P,A,1
4=SEC,P,A,1 4=vreg_twl,P,A,1
5=rtcif,P,A,1 5=pm0,P,A,1
6=vreg_twl,P,A,1 6=data,P,A,1
7=pm0,P,A,1 7=P5.3,P,A,1
8=data,P,A,1 8=p4.3,P,A,1
9=P5.3,P,A,1 9=pu0,P,A,1
10=p4.3,P,A,1 10=p5,B,A,1
11=pu0,P,A,1 11=P7,B,A,1
12=p5,B,A,1 12=cmd_BL,P,A,1
13=P7,B,A,1 13=vreg_ctr,P,A,1
14=cmd_BL,P,A,1 14=new_task,P,A,1
15=vreg_ctr,P,A,1 15=pool,P,A,1
[Software Break] [Software Break]
Geometry=1204, 674, 500, 428 Geometry=1204, 674, 500, 428
Window=Normal Window=Normal
Width=150 30 200 100 Width=150 30 200 100
Name0=Swb00003 Name0=Swb00003
Address0=renge.c#_renge_task_immed_add+0x3c Address0=renge.c#_renge_task_immed_add+0x3a
Window0=ASM Window0=ASM
Status0=ON Status0=ON
Name1=Swb00004 Name1=Swb00001
Address1=renge.c#_renge_task_immed_add+0x34 Address1=self_flash.c#_firm_duplicate+0x72
Window1=ASM Window1=ASM
Status1=ON Status1=ON
Name2=Swb00001 Name2=Swb00002
Address2=self_flash.c#_firm_duplicate+0x72 Address2=self_flash.c#_firm_duplicate+0x87
Window2=ASM Window2=ASM
Status2=ON Status2=ON
Name3=Swb00002 Name3=Swb00005
Address3=self_flash.c#_firm_duplicate+0x87 Address3=self_flash.c#_firm_duplicate+0x82
Window3=ASM Window3=ASM
Status3=ON Status3=ON
Name4=Swb00005 Name4=Swb00006
Address4=self_flash.c#_firm_duplicate+0x82 Address4=self_flash.c#_firm_duplicate+0x0
Window4=ASM Window4=ASM
Status4=ON Status4=ON
Name5=Swb00006 Name5=Swb00010
Address5=self_flash.c#_firm_duplicate+0x0 Address5=renge.c#_renge_task_immed_run+0xe6
Window5=ASM Window5=ASM
Status5=ON Status5=ON
Count=6 Name6=Swb00004
Address6=renge.c#_renge_task_immed_run+0x4c
Window6=ASM
Status6=ON
Name7=Swb00007
Address7=renge.c#_renge_task_immed_run+0xba
Window7=ASM
Status7=ON
Name8=Swb00008
Address8=renge.c#_renge_task_immed_run+0x12e
Window8=ASM
Status8=ON
Count=9
[Reset] [Reset]
Debugger=ON Debugger=ON
Symbol=OFF Symbol=OFF

View File

@ -11,18 +11,11 @@ OpenFile4=sw.c,0,132,132,1376,889,0,165,17,0
OpenFile5=vreg_ctr.c,0,159,252,1138,888,30,201,38,0 OpenFile5=vreg_ctr.c,0,159,252,1138,888,30,201,38,0
OpenFile6=renge\renge_task_immediate.h,0,308,308,1276,933,0,23,0,0 OpenFile6=renge\renge_task_immediate.h,0,308,308,1276,933,0,23,0,0
OpenFile7=renge\renge_defs.h,0,22,22,990,647,0,50,0,0 OpenFile7=renge\renge_defs.h,0,22,22,990,647,0,50,0,0
OpenFile8=accero.c,0,272,165,1516,922,0,114,13,0 OpenFile8=ProjectWindow
OpenFile9=main.c,0,66,66,1034,691,0,70,0,0
OpenFile10=renge\renge.c,0,285,287,1264,923,15,225,0,0
OpenFile11=task_misc.c,0,88,88,1056,713,5,159,5,0
OpenFile12=pm.c,0,421,154,1400,790,0,694,0,0
OpenFile13=adc.c,0,220,220,1199,856,0,111,0,0
OpenFile14=i2c_twl.c,0,44,44,1288,801,34,67,0,0
OpenFile15=ProjectWindow
PrjPos=0,2,754,3,253 PrjPos=0,2,754,3,253
OpenFile16=renge\renge_task_intval.h,0,155,11,1123,636,27,16,27,0 OpenFile9=renge\renge.h,0,502,637,1746,1394,29,16,29,0
OpenFile17=config.h,0,282,262,1526,1019,0,37,0,0 OpenFile10=main.c,0,66,66,913,691,22,70,0,0
OpenFile18=OutputWindow OpenFile11=OutputWindow
OutputPos=0,421,829,388,1497 OutputPos=0,421,829,388,1497
ActivePRJ=yav_mcu_bsr.prj ActivePRJ=yav_mcu_bsr.prj
[ProjectWindow] [ProjectWindow]

View File

@ -18,11 +18,11 @@ T=4b4d808f
4=pm.h 4=pm.h
5=renge\renge.h 5=renge\renge.h
[i2c_ctr.c] [i2c_ctr.c]
T=4b346598 T=4b57f645
1=incs.h 1=incs.h
2=accero.h 2=accero.h
[main.c] [main.c]
T=4b4d743c T=4b57fe0b
1=incs_loader.h 1=incs_loader.h
2=WDT.h 2=WDT.h
3=rtc.h 3=rtc.h
@ -31,7 +31,7 @@ T=4b4d743c
6=led.h 6=led.h
7=adc.h 7=adc.h
[magic.c] [magic.c]
T=4b4fe6cf T=4b58003f
1=config.h 1=config.h
[WDT.c] [WDT.c]
T=4afd21ca T=4afd21ca
@ -41,7 +41,7 @@ T=4b0bae4b
1=incs.h 1=incs.h
2=i2c_mcu.h 2=i2c_mcu.h
[i2c_twl.c] [i2c_twl.c]
T=4b43f5ff T=4b580039
1=incs.h 1=incs.h
2=i2c_twl_defs.h 2=i2c_twl_defs.h
[ini_VECT.c] [ini_VECT.c]
@ -55,7 +55,7 @@ T=4b4438bb
T=4b4438a1 T=4b4438a1
1=incs.h 1=incs.h
[vreg_ctr.c] [vreg_ctr.c]
T=4b4d747d T=4b57f3e1
1=incs.h 1=incs.h
2=vreg_ctr.h 2=vreg_ctr.h
3=rtc.h 3=rtc.h
@ -78,8 +78,8 @@ T=4b502014
3=pm.h 3=pm.h
4=led.h 4=led.h
[renge\renge.c] [renge\renge.c]
T=4b43f5e3 T=4b5802da
1=renge\renge_defs.h 1=renge\renge.h
2=renge\renge_task_intval.h 2=renge\renge_task_intval.h
3=renge\renge_task_immediate.h 3=renge\renge_task_immediate.h
4=WDT.h 4=WDT.h
@ -87,7 +87,7 @@ T=4b43f5e3
6=user_define.h 6=user_define.h
7=bsr_system.h 7=bsr_system.h
[accero.c] [accero.c]
T=4b4d8094 T=4b57fc13
1=incs.h 1=incs.h
2=..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h 2=..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h
[self_flash.c] [self_flash.c]
@ -198,7 +198,7 @@ T=4b25e780
[vreg_twl.h] [vreg_twl.h]
T=4afd21cb T=4afd21cb
[accero.h] [accero.h]
T=4b4d69bc T=4b57f3ee
1=jhl_defs.h 1=jhl_defs.h
[i2c_twl_defs.h] [i2c_twl_defs.h]
T=4afd21ca T=4afd21ca