一応ビルドはできるようになった。

レジスタを全部変数に宣言してあるだけ
ペリフェラルのレジスタ操作も正しくない
K0Rでもビルドできた。(正しいかは未検証)

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@484 013db118-44a6-b54f-8bf7-843cb86687b1
This commit is contained in:
n2232 2012-10-29 04:35:35 +00:00
parent 53eb60f4a2
commit a44e696248
36 changed files with 203 additions and 172 deletions

View File

@ -6,7 +6,7 @@
$Id: accero.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma NOP
@ -19,7 +19,7 @@
#endif
#ifndef _WIN32
#ifdef _78K0R
#pragma interrupt INTP23 intp23_ACC_ready RB3 // 加速度センサ、データ準備完了
@ -30,7 +30,7 @@
#include "i2c_mcu.h"
#ifndef _WIN32
#ifdef _78K0R
#include <math.h>
#endif
// ========================================================
@ -185,7 +185,7 @@ task_status_immed tski_acc_setup( )
// ピン不足のため、TSとそれ以外回路違いを区別して設定
if( system_status.model == MODEL_TS_BOARD )
{
str_send_buf[2] = bits8(0,0,0,0, 0,0,1,0);
str_send_buf[2] = bits8(0,0,0,0, 0,0,1,0);
}
else
{
@ -212,7 +212,7 @@ task_status_immed tski_acc_setup( )
| ACC_BITS_DR_100Hz << ACC_bP_DR0
| ACC_BITS_ALL_AXIS_ON );
}
// 実書き込み兼、通信できたかフラグ更新
if( iic_mcu_write( IIC_SLA_ACCEL, ( ACC_REG_CTRL1 | ACC_REG_FLG_BURST_ACCESS ), 4, str_send_buf ) == I2C_ERR_NOSLAVE )
{
@ -238,7 +238,7 @@ task_status_immed tski_acc_setup( )
}
// センサに書きにいっている最中にSoCがまた書き換えてしまうかもしれない
DI_wt_chk();
DI_wt_chk();
if( acc_setting_sent != ( vreg_ctr[VREG_C_ACC_CONFIG] & ( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ )))
{
// DI状態のまま帰る
@ -260,7 +260,7 @@ task_status_immed tski_acc_setup( )
__interrupt void intp23_ACC_ready( )
{
EI();
if( ( vreg_ctr[VREG_C_ACC_CONFIG] & ( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ ) ) != 0x00 )
if( ( vreg_ctr[VREG_C_ACC_CONFIG] & ( VREG_BITMASK_ACC_CONF_HOSU | VREG_BITMASK_ACC_CONF_ACQ ) ) != 0x00 )
{
// 加速度センサ on
if( ( system_status.pwr_state == ON ) || ( system_status.pwr_state == SLEEP ) )

View File

@ -24,7 +24,7 @@ const bt_param_ bt_param[ _BT_PARAM_NUM_ ] =
0x1C, 0x60, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00
},
2, // 2 = 19 bit mode
{ 92, (u8)(-256* 0.79), (u8)(-256* 4.35) }, //  (u8)誤キャストの誤パラメータのままの方が
{ 92, /*(u8)*/(-256* 0.79), /*(u8)*/(-256* 4.35) }, //  (u8)誤キャストの誤パラメータのままの方が
0xD800, // システムとしては良好な動作
{ 0xEA, 0xE8 }
},
@ -42,19 +42,19 @@ const bt_param_ bt_param[ _BT_PARAM_NUM_ ] =
0x07, 0x00, 0x09, 0x30, 0x01, 0xC0, 0x01, 0xC0
},
1,
{ 171, (u8)(-256* 1.00), (u8)(-256* 2.60) }, //  (u8)誤キャストの誤パラメータのままの方が
{ 171, /*(u8)*/(-256* 1.00), /*(u8)*/(-256* 2.60) }, //  (u8)誤キャストの誤パラメータのままの方が
0xDA20, // システムとしては良好な動作
{ 0x69, 0x67 },
},
// SPFL ///////////////////////////////////////////////
// BT_PARAM_SPFL_MAXELL
{
{
0xA1, 0x20, 0xB7, 0x50, 0xB9, 0xD0, 0xBB, 0x00,
0xA1, 0x20, 0xB7, 0x50, 0xB9, 0xD0, 0xBB, 0x00,
0xBC, 0x30, 0xBC, 0x60, 0xBC, 0xA0, 0xBD, 0x10,
0xBD, 0xC0, 0xBE, 0x70, 0xBF, 0xD0, 0xC2, 0xA0,
0xC4, 0x00, 0xC8, 0x50, 0xCC, 0x80, 0xD0, 0xB0,
0xC4, 0x00, 0xC8, 0x50, 0xCC, 0x80, 0xD0, 0xB0,
0x01, 0xA0, 0x25, 0x10, 0x18, 0xB0, 0x17, 0xC0,
0x95, 0x20, 0x6F, 0xE0, 0x7C, 0x60, 0x35, 0x10,
0x35, 0x00, 0x37, 0xF0, 0x16, 0xF0, 0x1C, 0xA0,
@ -107,11 +107,11 @@ const bt_param_ bt_param[ _BT_PARAM_NUM_ ] =
{
{
0x9D, 0xA0, 0xA8, 0xF0, 0xAD, 0x90, 0xAF, 0x00,
0xB3, 0x00, 0xB3, 0xE0, 0xB4, 0xA0, 0xB5, 0x40,
0xB3, 0x00, 0xB3, 0xE0, 0xB4, 0xA0, 0xB5, 0x40,
0xB6, 0x30, 0xB7, 0xE0, 0xB8, 0xC0, 0xBE, 0x70,
0xC1, 0x40, 0xC4, 0x20, 0xC9, 0xA0, 0xD0, 0x30,
0xC1, 0x40, 0xC4, 0x20, 0xC9, 0xA0, 0xD0, 0x30,
0x01, 0x10, 0x06, 0x00, 0x2C, 0x20, 0x0D, 0xA0,
0x37, 0x00, 0x37, 0x30, 0x47, 0xF0, 0x28, 0xF0,
0x37, 0x00, 0x37, 0x30, 0x47, 0xF0, 0x28, 0xF0,
0x25, 0xF0, 0x37, 0x30, 0x10, 0xF0, 0x14, 0xF0,
0x0F, 0x70, 0x0D, 0x00, 0x0D, 0x00, 0x0D, 0x00,
},

View File

@ -94,7 +94,7 @@
/* FLMD0 control bit */
#ifndef _WIN32
#ifdef _78K0R
#define FSL_FLMD0_HIGH {BECTL.7 = 1;}
#define FSL_FLMD0_LOW {BECTL.7 = 0;}
#else

View File

@ -1,9 +1,9 @@
/* ========================================================
HALレイヤ
$Id: asdf$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#endif
@ -127,7 +127,7 @@ void hal_update()
}
else
{
SW_HOME_n = SW_HOME_n_JIKKI_RAW;
SW_HOME_n = SW_HOME_n_JIKKI_RAW;
}
}

View File

@ -1,6 +1,10 @@
#ifndef _hal_h_
#define _hal_h_
#ifndef _78K0R
//#define bit bool
#define bit unsigned char
#endif
extern bit PM_EXTDC_n;
extern bit BT_IN_CHG_n;
@ -9,6 +13,7 @@ extern bit SW_HOME_n;
extern bit SW_WIFI_n;
extern bit SHELL_OPEN;
// ========================================================
void hal_update();
void hal_reset();

View File

@ -4,7 +4,7 @@
'09 Apr
$Id: i2c_ctr.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma interrupt INTIICA1 int_iic_ctr RB1
#endif
@ -46,7 +46,6 @@
#define TRC TRC1
#define SMC SMC1
#define DFC DFC1
#define IICS IICS1
#define PortMode PM20
#define Port P20
@ -82,7 +81,7 @@ static enum en_IIC_STATE state = IIC_IDLE;
/********************************************//**
isr
***********************************************/
__interrupt void int_iic_ctr( )
@ -98,7 +97,7 @@ __interrupt void int_iic_ctr( )
if( !bit_iics_ackd // 割り込み要因はNAKデータ送信の最後
|| bit_iics_spd ) // ストップコンディション(!ACKD に来たときは割り込み来ない (SPIE = 0))
{
/*
/*
I2Cの反応が遅くてこのフラグを処理する前にSTDがきてしまうことがある
*/

View File

@ -4,7 +4,7 @@
'09 Feb -
$Id$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma sfr
#pragma di
#pragma ei
@ -72,7 +72,7 @@ i2c_err iic_mcu_write_a_byte_codec( u8 adrs, u8 dat )
{
// 共有レジスタが 0x00 に書き換わっている(エラッタ発生!)ようなら書き戻す
u8 pm_reg_after;
if(( rv = iic_mcu_read( IIC_SLA_CODEC, CODEC_REG_PM, 1, &pm_reg_after )) != I2C_ERR_OK )
{
return( rv );

View File

@ -4,7 +4,7 @@
'09 Feb -
$Id$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma sfr
#pragma di
#pragma ei
@ -135,7 +135,7 @@ static i2c_err iic_mcu_wait_free()
1
iic_mcu_result
***********************************************/
u8 iic_mcu_read_a_byte( u8 SLA, u8 adrs )
@ -361,7 +361,7 @@ __interrupt void int_dma1( )
EI();
// 最後のバイトの送信完了待ち
while( ( SSR02L & TSF0 ) != 0 )
while( ( SSR02L & TSF0 ) != 0 )
{
u16 i = 0;
if( ++i == 0 ) // タイムアウト?
@ -413,7 +413,7 @@ __interrupt void int_dma1( )
DMAIF1 = 0;
DMAMK1 = 0;
DST1 = 1;
SIO10 = last_reg_adrs; // 書きっぱなし! 割り込みが発生してDMAスタート
return;
// おしまい

View File

@ -1,17 +1,15 @@
/* ========================================================
TWL I2C
$Id: i2c_twl.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#pragma sfr /* 特殊機能レジスタ使用 */
#ifdef _78K0R
# pragma sfr /* 特殊機能レジスタ使用 */
#endif
/*============================================================================*/
#ifndef _WIN32
#ifdef _78K0R
# pragma interrupt INTIICA0 int_iic_twl RB2
#endif
@ -97,7 +95,7 @@ enum IIC_TWL_STATE{
/********************************************//**
isr
TWLはウェイトを理解してくれずR/W
***********************************************/

View File

@ -1,4 +1,5 @@
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma di
#pragma ei
@ -7,16 +8,19 @@
#pragma halt
#endif
#ifndef _WIN32
#ifdef _78K0R
#pragma section @@CODE ROM_CODE
//#pragma section @@CNST ROM_CNST
#endif
#ifdef _WIN32
// VCの赤線をどうにかする
#include "sim/simOnWin.h"
# endif
# include "sim/simOnWin.h"
#endif
#ifdef _IAR
# include "sim/simOnWin.h"
#endif
//=========================================================

View File

@ -2,10 +2,10 @@
 volatileなのでタイミング依存で期待しない動作になるのを回避 
Hardware abstruct layer
$Id: asdf$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma di
#pragma ei
@ -13,7 +13,6 @@
#pragma stop
#pragma halt
#pragma section @@CODE LDR_CODE
#pragma section @@CODEL LDR_CODL
@ -23,11 +22,14 @@
#endif
# ifdef _WIN32
#ifdef _WIN32
// VCの赤線をどうにかする
#include "sim/simOnWin.h"
# endif
#ifdef _IAR
# include "sim/simOnWin.h"
#endif
//=========================================================
#include "jhl_defs.h"

View File

@ -3,7 +3,7 @@
$Id$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma nop
@ -11,11 +11,11 @@
#include "config.h"
#ifndef _WIN32
#ifdef _78K0R
#ifdef _WDT_CHECK_
#pragma interrupt INTWDTI fn_intwdti // wdt debug
#endif
# ifdef _WDT_CHECK_
# pragma interrupt INTWDTI fn_intwdti // wdt debug
# endif
//#pragma interrupt INTLVI fn_intlvi // ¢Žg—p

View File

@ -3,10 +3,8 @@
$Id: LED.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#pragma sfr
#ifdef _78K0R
# pragma sfr
#endif
#include "incs.h"
@ -100,7 +98,7 @@ u8 fade_to2( st_LED_dim_status* status )
/********************************************//**
LEDの初期化
HWタイマーを使うのでそれらの初期化を行う
***********************************************/
void LED_init( )
@ -152,7 +150,7 @@ void LED_init( )
/********************************************//**
LEDの停止
HWタイマーの停止
***********************************************/
@ -182,7 +180,7 @@ void LED_stop( )
/********************************************//**
WiFi LED
- on / off
- off -_-_-_--------_-_-_-------
***********************************************/
@ -358,7 +356,7 @@ void tsk_led_notify( )
calc_info_led_next_frame( &LED_dim_status_info_R, info_LED.info_LED.red[frame] );
calc_info_led_next_frame( &LED_dim_status_info_G, info_LED.info_LED.grn[frame] );
calc_info_led_next_frame( &LED_dim_status_info_B, info_LED.info_LED.blu[frame] );
}
time_to_next_frame --;
}

View File

@ -17,7 +17,7 @@
#define LED_duty_notify_blu TDR02
// これらはduty変えられません
#ifndef _WIN32
#ifdef _78K0R
#define LED_pow_red P4.2
#define LED_CAM P7.5
#else

View File

@ -5,12 +5,10 @@
OFFBLINK OFFが無視されます
$Id$
$Id: asdf$
*********************************************************/
#ifndef _WIN32
#pragma sfr
#ifdef _78K0R
# pragma sfr
#endif
#include "incs.h"

View File

@ -24,10 +24,8 @@ enum LED_ILUM_MODE{
LED_POW_ILM_CEOFF
};
======================================================== */
#ifndef _WIN32
#pragma sfr
#ifdef _78K0R
# pragma sfr
#endif
#include "incs.h"
@ -73,26 +71,26 @@ static u8 frame_sleep;
static st_LED_dim_status LED_dim_status_sleep;
extern bit ledInitialized;
extern bit BT_IN_CHG_delayed_n;
extern bit BT_IN_CHG_delayed_n;
/********************************************//**
LED
- > 10% master_brightnessの明るさ
- 5% (100%HW制限で調光不可)
- LED赤も同期する5%
- > 10% master_brightnessの明るさ
-
***********************************************/
void tsk_led_pow( )
@ -159,7 +157,7 @@ void tsk_led_pow( )
/********************************************//**
 
***********************************************/
static void led_pow_normal( )
@ -182,7 +180,7 @@ static void led_pow_normal( )
/********************************************//**
***********************************************/
static void led_pow_sleep( )

View File

@ -1,14 +1,14 @@
/* ========================================================
MCU CTR BSR
2009/03/30 -
2009/03/30 -
$Id: loader.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma di
@ -21,7 +21,10 @@
#endif
#include "incs_loader.h"
#ifdef _78K0R
#include <fsl.h>
#endif
#include "fsl_user.h"
#include "i2c_ctr.h"
@ -121,12 +124,12 @@ void main( )
//*/
hdwinit2( );
#ifndef _WIN32
#ifdef _78K0R
// ファームの整合性チェック //
chk_firm_broke(); // 壊れていたら帰ってこない
#endif
// 機種判定
// 機種判定
chk_platform_type();
// HALデバッグリセット
@ -183,7 +186,7 @@ static void chk_firm_broke()
CTRファミリ
DEV_DET(P12.[2:1])
CTR
@ -198,7 +201,7 @@ static void chk_firm_broke()
void chk_platform_type()
{
// ●CTRファミリ //
system_status.family = (enum family_)( DEV_DET >> 1 ); /// あぁ...
//iar! system_status.family = (enum family_)( DEV_DET >> 1 ); /// あぁ...
#ifdef _DBG_FORCE_SNAKE_
system_status.family = FAMILY_SNAKE;
#endif
@ -257,7 +260,7 @@ void chk_platform_type()
/********************************************//**
***********************************************/
void hdwinit( void )
@ -282,7 +285,7 @@ void hdwinit( void )
/********************************************//**
hdwinit
***********************************************/
static void hdwinit2( )

View File

@ -1,6 +1,6 @@
/********************************************//**
magic.c
(touch)
@ -10,7 +10,7 @@
#include "magic.h"
#include "config.h"
#ifndef _WIN32
#ifdef _78K0R
#pragma section @@CNSTL MGC_LOAD AT 0x0FF6
__far const unsigned char MGC_LOADd[] = __TIME__;

View File

@ -1,12 +1,12 @@
/* ********************************************************
3
$Id$
********************************************************* */
#ifndef _WIN32
#ifdef _78K0R
#pragma mul
#pragma div
@ -16,7 +16,7 @@
#include "incs.h"
#ifndef _WIN32
#ifdef _78K0R
#include <math.h>
#endif
@ -237,10 +237,10 @@ void hosu_increment_if_necessary()
cal_temp.year_bcd = YEAR;
cal_temp.min_bcd = MIN;
cal_temp.sec_bcd = SEC;
RWAIT = 0;
EI();
year_compd = bcdtob( cal_temp.year_bcd );
now_longhour = get_long_hour();
@ -286,7 +286,7 @@ void hosu_increment_if_necessary()
{ // これしないと1歩足りない
pool.vreg_c_ext.pedo_log[ p_record ] = 1;
}
else
else
{
// 通常パス
pool.vreg_c_ext.pedo_log[ p_record ] ++;
@ -316,7 +316,7 @@ void hosu_increment_if_necessary()
static void fill_hosu_hist_hours( u16 hours )
{
// ログあふれ?
if( (u16)p_record + hours >= PEDOMETER_LOG_SIZE )
if( (u16)p_record + hours >= PEDOMETER_LOG_SIZE )
{
pedolog_overflow = true;
return;

View File

@ -3,13 +3,11 @@
nintendo
'08 Dec
$Id: pm.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#pragma nop
#ifdef _78K0R
# pragma nop
#endif
#include "incs.h"
@ -20,7 +18,10 @@
#include "batt_params.h"
#include <fsl.h>
#ifdef _78K0R
# include <fsl.h>
#endif
#include "fsl_user.h"
#include "vreg_twl.h"
@ -155,7 +156,7 @@ void tsk_batt( )
static void update_chg_led()
{
static bit temp_led_chg; // static つけないとコンパイル通らず
temp_led_chg = false;
// アダプタつないだ瞬間、満充電でも数秒わざと点灯させる。給電してることをわからせるため。
@ -167,7 +168,7 @@ static void update_chg_led()
// CCIC は充電中と言っているか?
if( ! BT_IN_CHG_delayed_n // bt_get_charge_status()で更新されます。
&& ! PM_EXTDC_n )
&& ! PM_EXTDC_n )
{
temp_led_chg = true;
}
@ -231,7 +232,7 @@ void bt_chk_temparature()
/********************************************//**
ICのバグ対策も行う
***********************************************/
#define TIME_DENOIZE (u8)( 1000 / INTERVAL_TSK_BATT )
@ -255,7 +256,7 @@ void bt_get_charge_status()
}
else
{
if( !BT_CHG_Ena_n
if( !BT_CHG_Ena_n
&& ( vreg_ctr[ VREG_C_BT_REMAIN ] < 60 )
&& !( is_mgic_error )
)
@ -482,7 +483,7 @@ static void BT_mgic_quick_start()
/********************************************//**
***********************************************/
@ -670,7 +671,7 @@ void BT_get_left(){
{
// エミュレーション機能がおかしい
//  それで電源断は不便すぎるだろう
reg_volatile_temp_bt_remain = 99;
reg_volatile_temp_bt_remain = 99;
reg_volatile_temp_bt_remain_fine = 0;
}
}
@ -761,7 +762,7 @@ void BT_get_left(){
hysteresis = 500;
}
}
// 充電許可(=アダプタも刺さってる)のに充電してない
// かつ、少なくとも素の電池残量が60%以上CCICバグ回避、BT_IN_CHG_delayed_nに織り込み済み
@ -1113,7 +1114,7 @@ void PM_sys_pow_off( )
/********************************************//**
extDC割り込み
OFFから起こす
(pm)
@ -1126,7 +1127,7 @@ __interrupt void intp4_extdc( )
/********************************************//**
(misc)
***********************************************/
__interrupt void intp5_shell( )
@ -1193,7 +1194,7 @@ task_status_immed tski_ntr_pmic_comm( )
// EI();
vreg_ctr[ VREG_C_STATUS_1 ] = ( vreg_ctr[ VREG_C_STATUS_1 ] & ~REG_BIT_MASK_STATUS1_NTR_PM_REG )
vreg_ctr[ VREG_C_STATUS_1 ] = ( vreg_ctr[ VREG_C_STATUS_1 ] & ~REG_BIT_MASK_STATUS1_NTR_PM_REG )
| ( ntr_pm_reg_shadow & REG_BIT_MASK_STATUS1_NTR_PM_REG ); // TWLバックライト情報のミラー
irq_work &= ~vreg_ctr[ VREG_C_IRQ_MASK2 ];
@ -1337,7 +1338,7 @@ void bt_param_select()
{
bt_type_temp += BT_PARAM_SNAKE_MAXELL;
}
p_bt_param = &bt_param[ bt_type_temp ];
// iar! p_bt_param = &bt_param[ bt_type_temp ];
}

View File

@ -24,10 +24,10 @@
//=========================================================
#ifdef _WIN32
#define LED_CHARGE mcuRegP[ _P2_4 ]
#else
#ifdef _78K0R
#define LED_CHARGE P2.4
#else
#define LED_CHARGE mcuRegP[ _P2_4 ]
#endif

View File

@ -5,10 +5,9 @@
$Id$
**********************************************************/
#pragma SFR
#include "incs_loader.h"
#ifdef _78K0R
void my_reboot(){
#asm
@ -21,3 +20,10 @@ void my_reboot(){
#endasm
}
#endif
#ifdef _IAR
void my_reboot(){
}
#endif

View File

@ -1,4 +1,4 @@
#ifndef _WIN32
#ifdef _78K0R
#pragma section @@CODE ROM_CODE
#pragma nop
@ -9,6 +9,11 @@
#endif
#ifdef _IAR
typedef unsigned char bit;
typedef unsigned char u8;
#endif
#ifdef _WIN32
typedef unsigned char bit;
typedef unsigned char u8;
@ -29,9 +34,15 @@ typedef unsigned char u8;
#include "..\util_funcs.h"
#ifdef _IAR
#include "../sim/simOnWin.h"
#endif
#ifdef _WIN32
#include "../sim/simOnWin.h"
#endif
//#define _renge_test_
#define true 1
@ -218,7 +229,7 @@ __callt err renge_task_immed_run(){
rv = tasks_immed[ list_id ](); // タスク実行
if( rv == ERR_SUCCESS )
{
tasks_immed[ list_id ] = TSK_IMM_DELETED_;
// iar! tasks_immed[ list_id ] = TSK_IMM_DELETED_;
}
// きわどいタイミングで同じタスクの登録があると困るのでDI状態でかえって来る事がある
}

View File

@ -12,11 +12,21 @@
******************************************************************************/
#ifdef _78K0R
typedef unsigned char u8;
typedef signed char s8;
typedef unsigned short u16;
typedef signed short s16;
#else
#define __callt
#endif
// ************************************
#define SYS_INTERVAL_TICK 1.953

View File

@ -17,8 +17,8 @@ extern task_status_immed tski_vol_update();
// *************************************
#define TSK_IMM_EMPTY_ ( void * )( 0x0000 )
#define TSK_IMM_DELETED_ ( void * )( 0x0001 )
#define TSK_IMM_EMPTY_ ( task_status_immed )( 0x0000 )
#define TSK_IMM_DELETED_ ( task_status_immed(*)() )( 0x0001 )

View File

@ -7,7 +7,7 @@
enum TSK
{
TSK_SW, TSK_ADC, TSK_BATT, TSK_LED_POW, TSK_LED_WIFI, TSK_LED_NOTIFY, TSK_LED_CAM, TSK_MISC, TSK_STATUS, TSK_SYS, TSK_LAST
TSK_SW, TSK_ADC, TSK_BATT, TSK_LED_POW, TSK_LED_WIFI, TSK_LED_NOTIFY, TSK_LED_CAM, TSK_MISC, TSK_STATUS, TSK_SYS, TSK_LAST
};
extern void tsk_sw();
@ -21,7 +21,7 @@ extern void tsk_misc();
extern void tsk_status();
extern void tsk_sys();
const void ( *tasks[ TSK_LAST ] )() = {
/*const*/ void ( *tasks[ TSK_LAST ] )() = {
tsk_sw,
tsk_adc,
tsk_batt,

View File

@ -2,11 +2,9 @@
RTC
$Id$
======================================================== */
#ifndef _WIN32
#pragma sfr
#pragma inline
#ifdef _78K0R
# pragma sfr
# pragma inline
#endif
#include "incs.h"
@ -22,7 +20,7 @@ bit rtc_alarm_dirty;
/********************************************//**
***********************************************/
void RTC_init( void )
@ -94,7 +92,7 @@ __interrupt void int_rtc( )
/********************************************//**
RTC
sec,min,hour,week,day,month,year
***********************************************/
void rtc_buf_refresh( )

View File

@ -1,8 +1,8 @@
/* ========================================================
$Id$
$Id: qqqqq$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma di
@ -74,12 +74,12 @@ const u8 fsl_low_voltage_u08 = 1;
#define WTIM WTIM1
#endif
#ifndef _WIN32
#define LED_POW1 P4.2
#define LED_PM_POW1 PM4.2
#ifdef _78K0R
#define LED_POW1 P4.2
#define LED_PM_POW1 PM4.2
#else
#define LED_POW1 mcuRegP[ _P4_2 ]
#define LED_PM_POW1 mcuRegPM[ _P4_2 ]
#define LED_PM_POW1 mcuRegPM[ _P4_2 ]
#endif
// ========================================================

View File

@ -7,7 +7,7 @@
$Id$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma NOP
@ -91,7 +91,7 @@ static u16 sw_pwsw_mukan_time;
else \
{ \
count = 0; \
}
}
@ -133,7 +133,7 @@ void tsk_sw( )
// 実機の場合
if( ! system_status.taikendai )
{
// 電源スイッチの監視 //
if( SW_pow_count == ( TIME_PWSW_CLICK ) ) // クリック時間に到達
{
@ -160,7 +160,7 @@ void tsk_sw( )
force_off = true;
}
}
}else{
// スタンドアロン試遊台
// 電源スイッチの監視 //
@ -177,7 +177,7 @@ void tsk_sw( )
{
force_off = true;
}
if( sw_pwsw_mukan_time != 0 )
{
sw_pwsw_mukan_time--;
@ -189,7 +189,7 @@ void tsk_sw( )
// HOME sw //
chk_clicked( SW_HOME_n, SW_home_count, REG_BIT_SW_HOME_CLICK );
chk_clicked( !SW_HOME_n, SW_home_count_rel, REG_BIT_SW_HOME_RELEASE );
// wifi sw //
/// 最悪な実装なのはわかっているが、市場に出てしまった不良スイッチを救うため
if( sw_wifi_mukan_time != 0 )

View File

@ -2,7 +2,7 @@
$Id$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma NOP
@ -61,7 +61,7 @@ void tsk_debug( )
/*
{
u8 str[4];
if( ( system_status.pwr_state == ON ) || ( system_status.pwr_state == SLEEP ) )
{
str[3] = vreg_ctr[ VREG_C_FREE0 ];

View File

@ -5,7 +5,7 @@
$Id: task_misc.c 418 2011-09-22 01:35:37Z n2232 $
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma NOP
@ -67,7 +67,7 @@ bit going_to_sleep; // SoC
// 自動テスト用
bit reserve_pedo_increnent;
bit reserve_pedo_increnent;
// ========================================================
@ -235,7 +235,7 @@ void update_LED_3D()
COMMANDレジスタへの書き込み
0
- sleep ()
-
***********************************************/
@ -370,7 +370,7 @@ static const u8 *infos_table[ KOUMOKU ] = {
u8 extinfo_read(void)
{
u8 ret = 0xFF;
/*
* tempは計算処理が必要なデータ
* /
@ -380,12 +380,12 @@ u8 extinfo_read(void)
{
infos_temp[0] = system_status.captureBox? MODEL_CAPTURE_BOX
: ( system_status.is_dev? MODEL_ISBAKO: (u8)system_status.model );
infos_temp[1] = (u8)( _dbg_rcomp & 0xFF );
infos_temp[2] = ( !temp_zone_charge_disable | ( bt_authorized << 1 ) );
infos_temp[1] = (u8)( _dbg_rcomp & 0xFF );
infos_temp[2] = ( !temp_zone_charge_disable | ( bt_authorized << 1 ) );
infos_temp[3] = 1; /* 仕様変更により1固定になった */
infos_temp[4] = 0
// | ( PM_EXTDC_n ? REG_BIT_HAL0_PM_EXTDC_n : 0 ) // status0にある
| ( BT_IN_CHG_n ? REG_BIT_HAL0_BT_IN_CHG_n : 0 )
| ( BT_IN_CHG_n ? REG_BIT_HAL0_BT_IN_CHG_n : 0 )
| ( BT_CHG_Ena_n ? REG_BIT_HAL0_RSV_5 : 0 ) // 空きビット使用,out pin
| 0 // WL_TX 使えない
// | ( SHELL_OPEN ? REG_BIT_HAL0_SHELL_OPEN : 0 ) // status0にある

View File

@ -4,7 +4,7 @@
$Id$
********************************************************* */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma NOP

View File

@ -1,10 +1,10 @@
/* ========================================================
task_sys
$Id$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma NOP
@ -293,7 +293,7 @@ void tsk_sys( )
send_getup_to_soc();
system_status.pwr_state = ON;
}
force_off_check();
// leak_check();
@ -338,7 +338,7 @@ void tsk_sys( )
LED_stop( );
IIC_ctr_Stop( );
IIC_twl_Stop( );
RTC_32k_off();
//iar! RTC_32k_off();
// 電源オン条件の割り込みセット
// PWSW KR3 押すとL
@ -405,14 +405,14 @@ void tsk_sys( )
system_status.poweron_reason = NONE;
pwsw_timeout = 0;
if( !PM_EXTDC_n
if( !PM_EXTDC_n
|| chg_led_override != 0 ) // これがゼロになるまで待つ
{
// アダプタ有り /////////////////////////////// または、アダプタさして秒は充電LEDを点けている期間
// 電源ボタン押しチェックへ
system_status.poweron_reason = RSN_PWSW;
system_status.pwr_state = ON_CHECK;
system_status.pwr_state = ON_CHECK;
#ifndef _TAIKENDAI_SEISAN_SPECIAL_
// 試遊台なら自動で電源再投入
@ -487,7 +487,7 @@ void tsk_sys( )
}
RTCIMK = 0; // sys tick タイマー有効
#ifndef _TAIKENDAI_SEISAN_SPECIAL_
if( system_status.taikendai )
{
@ -616,7 +616,7 @@ void send_getup_to_soc()
/********************************************//**
firm_update() isr中から実行できないので
task_status_immed型 ...
***********************************************/
task_status_immed tski_firm_update(){

View File

@ -10,7 +10,7 @@
#define bits8(a,b,c,d,e,f,g,h) ( a<<7 | b<<6 | c<<5 | d<<4 | e<<3 | f<<2 | g<<1 | h )
#ifndef _WIN32
#ifdef _78K0R
// 実機環境
#ifdef _debug_led_
@ -173,7 +173,7 @@
#define PM_ACCEL_INT1 PM2.5
#endif // _WIN32
#endif // _WIN32
// win32 sim環境と共通

View File

@ -1,11 +1,11 @@
/* ========================================================
util_funcs
$Id$
$Id: asdf$
======================================================== */
#ifndef _WIN32
#ifdef _78K0R
#pragma SFR
#pragma di
@ -51,7 +51,7 @@ extern unsigned char get_ei();
#ifdef _DI_WITH_CHECK_
/********************************************//**
#ifdef DI
***********************************************/
void DI_wt_chk()

View File

@ -73,7 +73,7 @@ void vreg_ctr_init( )
/********************************************//**
***********************************************/
void vreg_ctr_reset( )
@ -96,8 +96,8 @@ void vreg_ctr_reset( )
vreg_ctr[ VREG_C_WIFI_CALIB ] = 0;
// ここでやるのは気持ち悪いが…
RTC_32k_on();
RESET1_neg;
//iar! RTC_32k_on();
//iar! RESET1_neg;
RESET2_neg;
FCRAM_RST_neg;
}
@ -325,14 +325,14 @@ void vreg_ctr_write( u8 adrs, u8 data )
case VREG_C_WIFI_CALIB:
if( data & REG_BIT_WIFI_CALIB_32K_HI_Z )
{
RTC_32k_HI_Z();
//iar! RTC_32k_HI_Z();
}
else{
RTC_32k_on();
//iar! RTC_32k_on();
}
if( data & REG_BIT_WIFI_CALIB_RSTS_AST )
{
RESET1_ast;
//iar! RESET1_ast;
// RESET2_ast; RESET1のみ。
// FCRAM_RST_ast;
}
@ -595,7 +595,7 @@ void set_irq( u8 irqreg, u8 irq_flg )
{
/*0 すでにDI状態ならケアが必要かもしれない
ei_orig = get_ei();
//. debug
if( !ei_orig )
{