mirror of
https://github.com/rvtr/ctr_mcu.git
synced 2025-10-31 13:51:10 -04:00
タスクシステムの初期化を先頭に持ってきた
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@68 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
parent
bbac8f6f0f
commit
c30f9cad91
@ -56,7 +56,8 @@ u16* hyst_pedometer;
|
||||
|
||||
|
||||
// ========================================================
|
||||
task_interval tsk_soft_int( );
|
||||
task_status tsk_soft_int( );
|
||||
|
||||
static void hosu_increment();
|
||||
u16 get_long_hour();
|
||||
|
||||
|
||||
@ -35,6 +35,8 @@ void main_loop( void )
|
||||
// 電池投入時、ファームアップデート後のみ
|
||||
RTC_init( ); // 内部でリブートか判定しています
|
||||
|
||||
renge_init( );
|
||||
|
||||
iic_mcu_start( );
|
||||
PM_init();
|
||||
|
||||
@ -64,7 +66,6 @@ void main_loop( void )
|
||||
|
||||
hosu_init();
|
||||
|
||||
renge_init( );
|
||||
renge_task_interval_run_force = 1;
|
||||
|
||||
EI( );
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
#include "adc.h"
|
||||
#include "led.h"
|
||||
#include "pm.h"
|
||||
|
||||
#include "renge.h"
|
||||
|
||||
|
||||
// ========================================================
|
||||
|
||||
@ -206,18 +206,22 @@ err renge_task_immed_run(){
|
||||
u8 i,j;
|
||||
|
||||
// リスト前詰め
|
||||
i = 0; // 前詰め後リストの最後尾
|
||||
j = 0; // リストの後ろの方のタスクを探す
|
||||
|
||||
for( ; j < TASK_IMMED_RUN_LIST_MAX; j++)
|
||||
// for( ; j <= last_task_id; j++) // 間で割り込まれたときに困る
|
||||
for( i = 0; i < TASK_IMMED_RUN_LIST_MAX; i++)
|
||||
{
|
||||
DI();
|
||||
DBG_LED_WIFI_2_on;
|
||||
if( tasks_immed[ i ] == TSK_IMM_DELETED_ )
|
||||
{
|
||||
tasks_immed[ i ] = TSK_IMM_EMPTY_;
|
||||
}
|
||||
}
|
||||
|
||||
i = 0; // 前詰め後リストの最後尾
|
||||
j = 0; // リストの後ろの方のタスクを探す
|
||||
for( j = 0; j < TASK_IMMED_RUN_LIST_MAX; j++)
|
||||
// for( ; j <= last_task_id; j++) // 間で割り込まれたときに困る
|
||||
{
|
||||
DI();
|
||||
DBG_LED_WIFI_2_on;
|
||||
if( tasks_immed[ i ] == TSK_IMM_EMPTY_ )
|
||||
{
|
||||
// 前詰めできるスペースを見つけた
|
||||
|
||||
@ -4,8 +4,7 @@ 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 -quvjl3wt -sainter_asm -zp -no renge\renge.c
|
||||
renge\renge.c(143) : CC78K0R warning W0401: Conversion may lose significant digits
|
||||
Compilation complete, 0 error(s) and 1 warning(s) found.
|
||||
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\renge.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
|
||||
@ -18,4 +17,4 @@ intel-HEX to bsr bin converter
|
||||
file converted!
|
||||
|
||||
|
||||
Build Total error(s) : 0 Total warning(s) : 1
|
||||
Build Total error(s) : 0 Total warning(s) : 0
|
||||
|
||||
@ -23,7 +23,7 @@ SubClock=None
|
||||
Count=0
|
||||
[Main]
|
||||
Geometry=66, 66, 1467, 1110
|
||||
Window=Normal
|
||||
Window=Max
|
||||
MDI_MAX=OFF
|
||||
Button=ON
|
||||
Mode=Auto
|
||||
@ -78,10 +78,10 @@ Symbol Type=OFF
|
||||
Language=C
|
||||
Kanji=SJIS
|
||||
[Source]
|
||||
Geometry=135, 77, 974, 1014
|
||||
Geometry=310, 103, 974, 1014
|
||||
Window=Normal
|
||||
DispStart=31
|
||||
CaretPos=87,0
|
||||
DispStart=262
|
||||
CaretPos=263,0
|
||||
Mode=Normal
|
||||
DispFile=
|
||||
Address1=
|
||||
@ -140,58 +140,26 @@ SaveStart=
|
||||
SaveEnd=
|
||||
Accumulative=ON
|
||||
[Source1]
|
||||
Geometry=0, 0, 904, 1014
|
||||
Geometry=35, 10, 974, 1014
|
||||
Window=Normal
|
||||
DispStart=318
|
||||
CaretPos=319,0
|
||||
Mode=Normal
|
||||
DispFile=pm.c
|
||||
Accumulative=ON
|
||||
[Source2]
|
||||
Geometry=0, 0, 904, 1014
|
||||
Window=Normal
|
||||
DispStart=159
|
||||
CaretPos=160,0
|
||||
Mode=Normal
|
||||
DispFile=pm.c
|
||||
Accumulative=ON
|
||||
[Source3]
|
||||
Geometry=25, 25, 904, 1014
|
||||
Window=Normal
|
||||
DispStart=24
|
||||
CaretPos=25,0
|
||||
Mode=Normal
|
||||
DispFile=vreg_twl.c
|
||||
Accumulative=ON
|
||||
[Source4]
|
||||
Geometry=50, 50, 904, 1014
|
||||
Window=Normal
|
||||
DispStart=271
|
||||
CaretPos=272,0
|
||||
Mode=Normal
|
||||
DispFile=vreg_ctr.c
|
||||
Accumulative=ON
|
||||
[Source5]
|
||||
Geometry=75, 75, 904, 1014
|
||||
Window=Normal
|
||||
DispStart=115
|
||||
CaretPos=116,0
|
||||
DispStart=8
|
||||
CaretPos=157,0
|
||||
Mode=Normal
|
||||
DispFile=task_misc.c
|
||||
Accumulative=ON
|
||||
[Source6]
|
||||
Geometry=0, 0, 974, 1014
|
||||
[Source2]
|
||||
Geometry=119, 82, 974, 1014
|
||||
Window=Normal
|
||||
DispStart=72
|
||||
CaretPos=143,0
|
||||
DispStart=145
|
||||
CaretPos=216,0
|
||||
Mode=Normal
|
||||
DispFile=vreg_ctr.c
|
||||
DispFile=loader.c
|
||||
Accumulative=ON
|
||||
[Assemble]
|
||||
Geometry=605, 2, 600, 400
|
||||
Window=Normal
|
||||
DispStart=687
|
||||
CaretPos=687,27
|
||||
DispStart=16229
|
||||
CaretPos=16229,27
|
||||
Address1=
|
||||
Address2=
|
||||
Address3=
|
||||
@ -299,7 +267,7 @@ Destination=0
|
||||
[I/O Port]
|
||||
Line=0
|
||||
[Stack]
|
||||
Geometry=777, 465, 400, 300
|
||||
Geometry=1072, 361, 400, 300
|
||||
Window=Normal
|
||||
Boundary=13762687
|
||||
Mode=Proper
|
||||
@ -903,63 +871,78 @@ Detail=OFF
|
||||
Last Name=
|
||||
Count=0
|
||||
[Variable]
|
||||
Geometry=1145, 8, 440, 1086
|
||||
Geometry=1225, 6, 354, 536
|
||||
Window=Normal
|
||||
Boundary=13762700
|
||||
0=.data,P,N,A,+,1
|
||||
1=.vreg_twl,P,N,A,+,1
|
||||
2=.blset,P,N,A,+,1
|
||||
3=.blset,P,N,A,+,1
|
||||
4=.pool,P,N,A,+,1
|
||||
5=.hyst_pedometer,.,N,A,+,1
|
||||
6=.P5.3,P,S,A,+,1
|
||||
7=.PM5.3,P,S,A,+,1
|
||||
8=.RTCEN,P,S,A,+,1
|
||||
9=.tasks_immed,P,N,A,+,1
|
||||
10=.system_status,.,N,A,+,1
|
||||
11=.hyst_pedometer,.,N,A,+,1
|
||||
12=.pool,P,N,A,+,1
|
||||
13=.last_year,P,N,A,+,1
|
||||
14=.last_month,P,N,A,+,1
|
||||
15=.last_day,P,N,A,+,1
|
||||
16=.last_hour,P,N,A,+,1
|
||||
17=.p_record,P,N,A,+,1
|
||||
18=.vreg_ctr[0x60],P,N,A,+,1
|
||||
Line=19
|
||||
0=.P0.0,P,S,A,+,1
|
||||
1=.p3.0,P,S,A,+,1
|
||||
2=.P0.1,P,S,A,+,1
|
||||
3=.system_status,.,N,A,+,1
|
||||
4=.last_task_id,P,N,A,+,1
|
||||
5=.i,P,N,A,+,1
|
||||
6=.j,P,N,A,+,1
|
||||
7=.list_id,P,N,A,+,1
|
||||
8=+tasks_immed,P,N,A,-,1
|
||||
9=.reg_shadow,P,N,A,+,1
|
||||
Line=10
|
||||
[Quick Watch]
|
||||
0=last_day,P,A,1
|
||||
1=last_month,P,A,1
|
||||
2=last_year,P,A,1
|
||||
3=p_record,P,A,1
|
||||
4=vreg_ctr,P,A,1
|
||||
5=vreg_ctr[0x60],P,A,1
|
||||
6=RTCEN,P,A,1
|
||||
7=system_status,P,A,1
|
||||
8=tasks_immed,P,A,1
|
||||
9=PM5.3,P,A,1
|
||||
10=P5.3,P,A,1
|
||||
11=hyst_pedometer,P,A,1
|
||||
12=pool,P,A,1
|
||||
13=blset,P,A,1
|
||||
14=vreg_twl,P,A,1
|
||||
15=data,P,A,1
|
||||
0=P2.4,B,A,1
|
||||
1=ADPC,P,A,1
|
||||
2=task_immed_run_list,P,A,1
|
||||
3=tasks_immed,P,A,1
|
||||
4=last_task_id,P,A,1
|
||||
5=j,P,A,1
|
||||
6=system_status,P,A,1
|
||||
7=RESET1_n,P,A,1
|
||||
8=P0.0,P,A,1
|
||||
9=P0.1,P,A,1
|
||||
10=p14.0,P,A,1
|
||||
11=reg_shadow,P,A,1
|
||||
12=list_id,P,A,1
|
||||
13=p[14,P,A,1
|
||||
14=p14,P,A,1
|
||||
15=p3.0,P,A,1
|
||||
[Software Break]
|
||||
Geometry=25, 25, 500, 428
|
||||
Geometry=1204, 674, 500, 428
|
||||
Window=Normal
|
||||
Width=150 30 200 100
|
||||
Name0=Swb00001
|
||||
Address0=accero.c#_hosu_increment+0x36
|
||||
Name0=Swb00002
|
||||
Address0=renge.c#_renge_task_immed_add+0x59
|
||||
Window0=ASM
|
||||
Status0=ON
|
||||
Name1=Swb00002
|
||||
Address1=accero.c#_hosu_increment+0x52
|
||||
Name1=Swb00003
|
||||
Address1=renge.c#_renge_task_immed_add+0x4e
|
||||
Window1=ASM
|
||||
Status1=ON
|
||||
Name2=Swb00006
|
||||
Address2=pm.c#_PM_init+0x38
|
||||
Name2=Swb00009
|
||||
Address2=renge.c#_renge_task_immed_run+0x25
|
||||
Window2=ASM
|
||||
Status2=OFF
|
||||
Count=3
|
||||
Status2=ON
|
||||
Name3=Swb00005
|
||||
Address3=pm.c#_ntr_pmic_comm+0x86
|
||||
Window3=ASM
|
||||
Status3=ON
|
||||
Name4=Swb00006
|
||||
Address4=task_misc.c#_do_command+0x8
|
||||
Window4=ASM
|
||||
Status4=ON
|
||||
Name5=Swb00001
|
||||
Address5=task_misc.c#_do_command+0x15
|
||||
Window5=ASM
|
||||
Status5=ON
|
||||
Name6=Swb00004
|
||||
Address6=task_misc.c#_do_command+0x34
|
||||
Window6=ASM
|
||||
Status6=ON
|
||||
Name7=Swb00007
|
||||
Address7=task_misc.c#_do_command+0x44
|
||||
Window7=ASM
|
||||
Status7=ON
|
||||
Name8=Swb00008
|
||||
Address8=pm.c#_PM_sys_pow_on+0x6f
|
||||
Window8=ASM
|
||||
Status8=ON
|
||||
Count=9
|
||||
[Reset]
|
||||
Debugger=ON
|
||||
Symbol=OFF
|
||||
|
||||
@ -11,10 +11,12 @@ OpenFile4=adc.c,0,220,220,1199,856,0,112,0,0
|
||||
OpenFile5=loader.c,0,266,31,1510,788,23,43,23,0
|
||||
OpenFile6=sw.c,0,132,132,1376,889,0,166,17,0
|
||||
OpenFile7=pm.c,0,421,154,1400,790,25,271,0,0
|
||||
OpenFile8=config.h,0,282,262,1526,1019,0,17,19,0
|
||||
OpenFile8=config.h,0,282,262,1526,1019,0,19,0,0
|
||||
OpenFile9=ProjectWindow
|
||||
PrjPos=0,2,754,3,253
|
||||
OpenFile10=OutputWindow
|
||||
OpenFile10=vreg_ctr.c,0,264,264,1243,900,0,344,0,0
|
||||
OpenFile11=renge\renge.c,0,286,286,1265,922,0,136,0,0
|
||||
OpenFile12=OutputWindow
|
||||
OutputPos=0,229,1000,411,1513
|
||||
ActivePRJ=yav_mcu_bsr.prj
|
||||
[ProjectWindow]
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[SdbInfo]
|
||||
Ver=5
|
||||
[loader.c]
|
||||
T=4b1efd24
|
||||
T=4b3081f8
|
||||
1=incs_loader.h
|
||||
2=fsl.h
|
||||
3=fsl_user.h
|
||||
@ -30,7 +30,7 @@ T=4b25f14b
|
||||
6=led.h
|
||||
7=adc.h
|
||||
[magic.c]
|
||||
T=4b2b2791
|
||||
T=4b30a8db
|
||||
1=config.h
|
||||
[WDT.c]
|
||||
T=4afd21ca
|
||||
@ -47,14 +47,14 @@ T=4b03aa74
|
||||
T=4afd21ca
|
||||
1=config.h
|
||||
[led.c]
|
||||
T=4b2f279a
|
||||
T=4b307b06
|
||||
1=incs.h
|
||||
2=led.h
|
||||
[rtc.c]
|
||||
T=4b1f4275
|
||||
T=4b305de2
|
||||
1=incs.h
|
||||
[vreg_ctr.c]
|
||||
T=4b20a996
|
||||
T=4b309cbf
|
||||
1=incs.h
|
||||
2=vreg_ctr.h
|
||||
3=rtc.h
|
||||
@ -71,21 +71,22 @@ T=4b1c8d36
|
||||
4=vreg_ctr.h
|
||||
5=renge\renge_task_intval.h
|
||||
[adc.c]
|
||||
T=4b25ee1e
|
||||
T=4b308310
|
||||
1=incs.h
|
||||
2=adc.h
|
||||
3=pm.h
|
||||
4=led.h
|
||||
[renge\renge.c]
|
||||
T=4b205fce
|
||||
T=4b30a8e8
|
||||
1=renge\renge_defs.h
|
||||
2=renge\renge_task_intval.h
|
||||
3=renge\renge_task_immediate.h
|
||||
4=WDT.h
|
||||
5=config.h
|
||||
6=bsr_system.h
|
||||
6=user_define.h
|
||||
7=bsr_system.h
|
||||
[accero.c]
|
||||
T=4b2611c9
|
||||
T=4b309c03
|
||||
1=incs.h
|
||||
2=..\..\Program Files\NEC Electronics Tools\CC78K0R\W2.10\inc78k0r\math.h
|
||||
[self_flash.c]
|
||||
@ -107,7 +108,7 @@ T=4b21cccc
|
||||
6=pm.h
|
||||
7=rtc.h
|
||||
[task_debug.c]
|
||||
T=4b14e842
|
||||
T=4b3056a4
|
||||
1=incs.h
|
||||
2=renge\renge.h
|
||||
3=pm.h
|
||||
@ -143,18 +144,17 @@ T=4b25f1a9
|
||||
T=4b023fdb
|
||||
1=config.h
|
||||
[user_define.h]
|
||||
T=4b1cdaa0
|
||||
1=config.h
|
||||
T=4b307b06
|
||||
[config.h]
|
||||
T=4b2f27c7
|
||||
T=4b306830
|
||||
[bsr_system.h]
|
||||
T=4afd21ca
|
||||
T=4b3064de
|
||||
[renge\renge.h]
|
||||
T=4b024862
|
||||
1=renge\renge_defs.h
|
||||
2=renge\renge_task_immediate.h
|
||||
[renge\renge_defs.h]
|
||||
T=4b024862
|
||||
T=4b30a8e8
|
||||
[renge\renge_task_immediate.h]
|
||||
T=4afa8168
|
||||
1=renge\renge_defs.h
|
||||
@ -205,7 +205,7 @@ T=4afd21ca
|
||||
T=4ac9ab84
|
||||
1=renge\renge_defs.h
|
||||
[i2c_twl.h]
|
||||
T=4afd21ca
|
||||
T=4b309c28
|
||||
[..\..\Program Files\NEC Electronics Tools\FSL78K0R_Type02ES\V1.20\inc78k0r\fsl.h]
|
||||
T=49a3bd4e
|
||||
[reboot.h]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user