お知らせLEDの最終フレームリピート回数が、(リピート中にデータ更新すると)次のループから反映されるのを修正

歩数計が年をまたぐとき(で、境界が0分0秒以外の時)、ログの時刻が期待通りでなかった

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@217 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
N2232 2010-08-04 08:06:33 +00:00
parent a00fc7ed9e
commit cb4c756204
10 changed files with 743 additions and 775 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -23,8 +23,8 @@ Direc-file:bsr_mcu.dr
*** Link information *** *** Link information ***
65 output segment(s) 65 output segment(s)
3E1CH byte(s) real data 3E04H byte(s) real data
5483 symbol(s) defined 5479 symbol(s) defined
*** Memory map *** *** Memory map ***
@ -99,55 +99,55 @@ Direc-file:bsr_mcu.dr
000C4H 00000H 000C4H 00000H
* gap * 000C4H 0000AH * gap * 000C4H 0000AH
?OCDSTAD 000CEH 0000AH CSEG ?OCDSTAD 000CEH 0000AH CSEG
LDR_CODE 000D8H 008FBH CSEG LDR_CODE 000D8H 008FCH CSEG
LDR_CODE loader 000D8H 001CCH LDR_CODE loader 000D8H 001CCH
LDR_CODE main 002A4H 0006EH LDR_CODE main 002A4H 0006EH
LDR_CODE WDT 00312H 00000H LDR_CODE WDT 00312H 00000H
LDR_CODE i2c_mcu 00312H 002F1H LDR_CODE i2c_mcu 00312H 002F1H
LDR_CODE self_flash LDR_CODE self_flash
00603H 0034AH 00603H 0034BH
LDR_CODE task_debug LDR_CODE task_debug
0094DH 00001H 0094EH 00001H
LDR_CODE task_status LDR_CODE task_status
0094EH 00085H 0094FH 00085H
FSL_CODE 009D3H 00322H CSEG FSL_CODE 009D4H 00322H CSEG
FSL_CODE fsl_block_cmd FSL_CODE fsl_block_cmd
009D3H 0002BH 009D4H 0002BH
FSL_CODE fsl_block_check FSL_CODE fsl_block_check
009FEH 00013H 009FFH 00013H
FSL_CODE fsl_common FSL_CODE fsl_common
00A11H 0014FH 00A12H 0014FH
FSL_CODE fsl_reset FSL_CODE fsl_reset
00B60H 00001H 00B61H 00001H
FSL_CODE fsl_si_ibf FSL_CODE fsl_si_ibf
00B61H 00064H 00B62H 00064H
FSL_CODE fsl_phySwap FSL_CODE fsl_phySwap
00BC5H 0004DH 00BC6H 0004DH
FSL_CODE fsl_si_common FSL_CODE fsl_si_common
00C12H 00061H 00C13H 00061H
FSL_CODE fsl_swap 00C73H 00030H FSL_CODE fsl_swap 00C74H 00030H
FSL_CODE fsl_write FSL_CODE fsl_write
00CA3H 00052H 00CA4H 00052H
@@LCODE 00CF5H 002AFH CSEG @@LCODE 00CF6H 002AFH CSEG
@@LCODE @cstart 00CF5H 0006DH @@LCODE @cstart 00CF6H 0006DH
@@LCODE @imul 00D62H 00011H @@LCODE @imul 00D63H 00011H
@@LCODE @lumul 00D73H 0002BH @@LCODE @lumul 00D74H 0002BH
@@LCODE @isdiv 00D9EH 00022H @@LCODE @isdiv 00D9FH 00022H
@@LCODE @iudiv 00DC0H 0002DH @@LCODE @iudiv 00DC1H 0002DH
@@LCODE @isrem 00DEDH 00021H @@LCODE @isrem 00DEEH 00021H
@@LCODE @iurem 00E0EH 0002FH @@LCODE @iurem 00E0FH 0002FH
@@LCODE @lsdiv 00E3DH 00039H @@LCODE @lsdiv 00E3EH 00039H
@@LCODE @ludiv 00E76H 0003FH @@LCODE @ludiv 00E77H 0003FH
@@LCODE @divuw 00EB5H 00034H @@LCODE @divuw 00EB6H 00034H
@@LCODE @ladd 00EE9H 0000FH @@LCODE @ladd 00EEAH 0000FH
@@LCODE @llsh 00EF8H 0001BH @@LCODE @llsh 00EF9H 0001BH
@@LCODE @lursh 00F13H 0001FH @@LCODE @lursh 00F14H 0001FH
@@LCODE @iscmp 00F32H 0000CH @@LCODE @iscmp 00F33H 0000CH
@@LCODE @lscmp 00F3EH 00014H @@LCODE @lscmp 00F3FH 00014H
@@LCODE @lband 00F52H 00014H @@LCODE @lband 00F53H 00014H
@@LCODE @bcdtob 00F66H 0001AH @@LCODE @bcdtob 00F67H 0001AH
@@LCODE @bbcd 00F80H 00024H @@LCODE @bbcd 00F81H 00024H
* gap * 00FA4H 00052H * gap * 00FA5H 00051H
MGC_LOAD 00FF6H 0000AH CSEG AT MGC_LOAD 00FF6H 0000AH CSEG AT
MGC_LOAD magic 00FF6H 0000AH MGC_LOAD magic 00FF6H 0000AH
@ -369,53 +369,53 @@ Direc-file:bsr_mcu.dr
@@CNST ini_VECT 023C4H 00000H @@CNST ini_VECT 023C4H 00000H
@@CNST task_status @@CNST task_status
023C4H 00000H 023C4H 00000H
ROM_CODE 023C4H 026E5H CSEG ROM_CODE 023C4H 026CCH CSEG
ROM_CODE pm 023C4H 00A34H ROM_CODE pm 023C4H 00A34H
ROM_CODE i2c_ctr 02DF8H 00060H ROM_CODE i2c_ctr 02DF8H 00060H
ROM_CODE i2c_twl 02E58H 0005EH ROM_CODE i2c_twl 02E58H 0005EH
ROM_CODE led 02EB6H 00511H ROM_CODE led 02EB6H 0050CH
ROM_CODE rtc 033C7H 000E0H ROM_CODE rtc 033C2H 000E0H
ROM_CODE vreg_ctr 034A7H 00457H ROM_CODE vreg_ctr 034A2H 00457H
ROM_CODE vreg_twl 038FEH 00122H ROM_CODE vreg_twl 038F9H 00122H
ROM_CODE adc 03A20H 002B9H ROM_CODE adc 03A1BH 002B9H
ROM_CODE renge 03CD9H 001C3H ROM_CODE renge 03CD4H 001C3H
ROM_CODE accero 03E9CH 0013DH ROM_CODE accero 03E97H 0013DH
ROM_CODE sw 03FD9H 000F5H ROM_CODE sw 03FD4H 000F5H
ROM_CODE task_misc ROM_CODE task_misc
040CEH 001C1H 040C9H 001C1H
ROM_CODE task_sys 0428FH 0030BH ROM_CODE task_sys 0428AH 0030BH
ROM_CODE pedo_alg_thre_det2 ROM_CODE pedo_alg_thre_det2
0459AH 0050FH 04595H 004FBH
@@BASE 04AA9H 0050BH CSEG BASE @@BASE 04A90H 0050BH CSEG BASE
@@BASE loader 04AA9H 00000H @@BASE loader 04A90H 00000H
@@BASE pm 04AA9H 00043H @@BASE pm 04A90H 00043H
@@BASE i2c_ctr 04AECH 00198H @@BASE i2c_ctr 04AD3H 00198H
@@BASE main 04C84H 00000H @@BASE main 04C6BH 00000H
@@BASE magic 04C84H 00000H @@BASE magic 04C6BH 00000H
@@BASE WDT 04C84H 00000H @@BASE WDT 04C6BH 00000H
@@BASE i2c_mcu 04C84H 000D9H @@BASE i2c_mcu 04C6BH 000D9H
@@BASE i2c_twl 04D5DH 000CDH @@BASE i2c_twl 04D44H 000CDH
@@BASE led 04E2AH 00000H @@BASE led 04E11H 00000H
@@BASE rtc 04E2AH 00052H @@BASE rtc 04E11H 00052H
@@BASE vreg_ctr 04E7CH 00000H @@BASE vreg_ctr 04E63H 00000H
@@BASE vreg_twl 04E7CH 00000H @@BASE vreg_twl 04E63H 00000H
@@BASE adc 04E7CH 000B3H @@BASE adc 04E63H 000B3H
@@BASE renge 04F2FH 00000H @@BASE renge 04F16H 00000H
@@BASE accero 04F2FH 0004AH @@BASE accero 04F16H 0004AH
@@BASE self_flash @@BASE self_flash
04F79H 00000H 04F60H 00000H
@@BASE sw 04F79H 00000H @@BASE sw 04F60H 00000H
@@BASE task_debug @@BASE task_debug
04F79H 00000H 04F60H 00000H
@@BASE task_misc @@BASE task_misc
04F79H 00000H 04F60H 00000H
@@BASE task_sys 04F79H 00000H @@BASE task_sys 04F60H 00000H
@@BASE pedo_alg_thre_det2 @@BASE pedo_alg_thre_det2
04F79H 00000H 04F60H 00000H
@@BASE ini_VECT 04F79H 0003BH @@BASE ini_VECT 04F60H 0003BH
@@BASE task_status @@BASE task_status
04FB4H 00000H 04F9BH 00000H
* gap * 04FB4H 00042H * gap * 04F9BH 0005BH
MGC_TAIL 04FF6H 0000AH CSEG AT MGC_TAIL 04FF6H 0000AH CSEG AT
MGC_TAIL magic 04FF6H 0000AH MGC_TAIL magic 04FF6H 0000AH

Binary file not shown.

View File

@ -507,7 +507,7 @@ void tsk_led_notify( )
{ {
static u8 time_to_next_frame; static u8 time_to_next_frame;
static u8 frame; static u8 frame;
static u8 loops_to_go; static u8 loops;
static st_LED_dim_status LED_dim_status_info_R, LED_dim_status_info_G, LED_dim_status_info_B; static st_LED_dim_status LED_dim_status_info_R, LED_dim_status_info_G, LED_dim_status_info_B;
if( info_led_override ) if( info_led_override )
@ -548,7 +548,6 @@ void tsk_led_notify( )
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP; vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP;
frame = 0; // ちゃんと書こう frame = 0; // ちゃんと書こう
time_to_next_frame = 0; time_to_next_frame = 0;
loops_to_go = 0;
} }
else else
{ {
@ -562,21 +561,18 @@ void tsk_led_notify( )
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] |= REG_BIT_IN_LOOP; vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] |= REG_BIT_IN_LOOP;
if( info_LED.info_LED.last_loop != 255 ) // 255:無限ループ if( info_LED.info_LED.last_loop != 255 ) // 255:無限ループ
{ {
if( loops_to_go != 0 ) loops++;
if( loops > info_LED.info_LED.last_loop )
{ {
loops_to_go -= 1;
}
else
{
loops_to_go = info_LED.info_LED.last_loop;
frame = 0; frame = 0;
} }
} }
} }
else else
{ {
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP;
frame = (( frame + 1 ) & 0x1F ); // ←ここでマスクをかけておかないと最終フレーム~先頭間のグラデが効かない frame = (( frame + 1 ) & 0x1F ); // ←ここでマスクをかけておかないと最終フレーム~先頭間のグラデが効かない
vreg_ctr[ VREG_C_LED_NOTIFY_FLAG ] &= ~REG_BIT_IN_LOOP;
loops = 0;
} }
LED_dim_status_info_R.to = info_LED.info_LED.red[frame] * 128; LED_dim_status_info_R.to = info_LED.info_LED.red[frame] * 128;

View File

@ -238,14 +238,7 @@ static void hosu_increment()
// 元旦零時台で昨日扱いになった場合の帳尻合わせ // 元旦零時台で昨日扱いになった場合の帳尻合わせ
if( now_longhour == 65535 ) if( now_longhour == 65535 )
{
now_longhour = ( ( 365 + (( now_year & 0x03 ) == 1 ? 1: 0 )) * 24 ) -1; now_longhour = ( ( 365 + (( now_year & 0x03 ) == 1 ? 1: 0 )) * 24 ) -1;
now_year -= 1;
last_hour = 0x23;
last_month = 0x12;
last_day = 0x31;
now_min = 0x59;
now_sec = 0x59;
} }
// 歩数計が止まっていた時間を考慮して必要なら進める // // 歩数計が止まっていた時間を考慮して必要なら進める //

View File

@ -10,31 +10,10 @@ led.c(249) : CC78K0R warning W0401: Conversion may lose significant digits
led.c(311) : CC78K0R warning W0401: Conversion may lose significant digits led.c(311) : CC78K0R warning W0401: Conversion may lose significant digits
led.c(370) : CC78K0R warning W0401: Conversion may lose significant digits led.c(370) : CC78K0R warning W0401: Conversion may lose significant digits
led.c(396) : CC78K0R warning W0401: Conversion may lose significant digits led.c(396) : CC78K0R warning W0401: Conversion may lose significant digits
led.c(579) : CC78K0R warning W0401: Conversion may lose significant digits led.c(573) : CC78K0R warning W0401: Conversion may lose significant digits
Compilation complete, 0 error(s) and 7 warning(s) found. Compilation complete, 0 error(s) and 7 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\led.asm "C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\ra78k0r.exe" -c9F0104 -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff inter_asm\led.asm
Assembly complete, 0 error(s) and 0 warning(s) found. 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 -qvjl2w -sainter_asm -zpb -no vreg_ctr.c
vreg_ctr.c(114) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(123) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(132) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(142) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(146) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(153) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(163) : CC78K0R warning W0401: Conversion may lose significant digits
vreg_ctr.c(164) : CC78K0R warning W0401: Conversion may lose significant digits
vreg_ctr.c(166) : CC78K0R warning W0401: Conversion may lose significant digits
vreg_ctr.c(168) : CC78K0R warning W0401: Conversion may lose significant digits
vreg_ctr.c(169) : CC78K0R warning W0401: Conversion may lose significant digits
vreg_ctr.c(257) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(262) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(267) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(297) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(313) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
vreg_ctr.c(423) : CC78K0R warning W0510: Pointer mismatch in function 'renge_task_immed_add'
Compilation complete, 0 error(s) and 17 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\vreg_ctr.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 -pbsr_k0r.map -nkd -gb7EFFFFh -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 led.rel rtc.rel vreg_ctr.rel vreg_twl.rel adc.rel renge.rel accero.rel self_flash.rel sw.rel task_debug.rel task_misc.rel task_sys.rel pedo_alg_thre_det2.rel ini_VECT.rel task_status.rel "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 -pbsr_k0r.map -nkd -gb7EFFFFh -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 led.rel rtc.rel vreg_ctr.rel vreg_twl.rel adc.rel renge.rel accero.rel self_flash.rel sw.rel task_debug.rel task_misc.rel task_sys.rel pedo_alg_thre_det2.rel ini_VECT.rel task_status.rel
Link complete, 0 error(s) and 0 warning(s) found. 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 -ki -U0FFH -R bsr.lmf "C:\Program Files\NEC Electronics Tools\RA78K0R\W1.31\bin\oc78k0r.exe" -y"C:\Program Files\NEC Electronics Tools\DEV" -_msgoff -o.\bsr.hex -ki -U0FFH -R bsr.lmf
@ -45,4 +24,4 @@ intel-HEX to bsr bin converter
file converted! file converted!
Build Total error(s) : 0 Total warning(s) : 24 Build Total error(s) : 0 Total warning(s) : 7

View File

@ -80,8 +80,8 @@ Kanji=SJIS
[Source] [Source]
Geometry=406, 215, 757, 775 Geometry=406, 215, 757, 775
Window=Normal Window=Normal
DispStart=70 DispStart=41
CaretPos=117,0 CaretPos=79,0
Mode=Normal Mode=Normal
DispFile= DispFile=
Address1= Address1=
@ -274,8 +274,8 @@ Address13=
Address14= Address14=
Address15= Address15=
Address16= Address16=
Boundary=202, 89 Boundary=0, 0
Mode=Bin Mode=Hex
Attribute=Show Attribute=Show
Sort=Unsort Sort=Unsort
Pickup=OFF Pickup=OFF

View File

@ -1,13 +1,14 @@
[ProjectManager] [ProjectManager]
FrameMax=1 FrameMax=0
FrameX=0 FrameX=0
FrameY=55 FrameY=55
FrameCX=1299 FrameCX=1299
FrameCY=1044 FrameCY=1044
OpenFile1=ProjectWindow OpenFile1=ProjectWindow
PrjPos=0,2,754,3,253 PrjPos=0,2,754,3,253
OpenFile2=task_misc.c,0,352,352,1596,1109,0,231,0,0 OpenFile2=task_sys.c,0,110,110,1354,867,0,329,0,0
OpenFile3=OutputWindow OpenFile3=task_misc.c,0,352,352,1596,1109,0,219,0,0
OpenFile4=OutputWindow
OutputPos=0,73,1018,56,1365 OutputPos=0,73,1018,56,1365
ActivePRJ=yav_mcu_bsr.prj ActivePRJ=yav_mcu_bsr.prj
[ProjectWindow] [ProjectWindow]

View File

@ -36,7 +36,7 @@ T=4c3c0229
7=adc.h 7=adc.h
8=pool.h 8=pool.h
[magic.c] [magic.c]
T=4c576a1d T=4c58c413
1=config.h 1=config.h
[WDT.c] [WDT.c]
T=4bf0d1e1 T=4bf0d1e1
@ -52,14 +52,14 @@ T=4c29c700
3=i2c_twl_defs.h 3=i2c_twl_defs.h
4=i2c_twl.h 4=i2c_twl.h
[led.c] [led.c]
T=4c4ff708 T=4c58fedd
1=incs.h 1=incs.h
2=led.h 2=led.h
[rtc.c] [rtc.c]
T=4c3db81b T=4c58bce4
1=incs.h 1=incs.h
[vreg_ctr.c] [vreg_ctr.c]
T=4c510269 T=4c58f6a2
1=incs.h 1=incs.h
2=vreg_ctr.h 2=vreg_ctr.h
3=rtc.h 3=rtc.h