From c38c488949a78b4235f1d6f71510916242b9e3a7 Mon Sep 17 00:00:00 2001 From: n2232 Date: Thu, 28 Jul 2011 06:55:30 +0000 Subject: [PATCH] =?UTF-8?q?I2C=E3=83=AC=E3=82=B8=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=81=AE=E5=8A=A0=E9=80=9F=E5=BA=A6=E5=80=A4=E3=81=AE=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E3=82=92=E3=82=A2=E3=83=88=E3=83=9F=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_mcu@355 013db118-44a6-b54f-8bf7-843cb86687b1 --- branches/sim/accero.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/branches/sim/accero.c b/branches/sim/accero.c index 96ea6dc..dc52759 100644 --- a/branches/sim/accero.c +++ b/branches/sim/accero.c @@ -79,9 +79,10 @@ task_status tsk_soft_int( ); task_status_immed tski_cbk_accero( ) { // (疑似)isrから登録されます static u8 err_count; + u8 acc_dat_buff[6]; // 加速度センサデータレジスタへの反映 - if( iic_mcu_read( IIC_SLA_ACCEL, ( ACC_REG_X | 0x80 ), 6, &vreg_ctr[VREG_C_ACC_XL] ) + if( iic_mcu_read( IIC_SLA_ACCEL, ( ACC_REG_X | 0x80 ), 6, acc_dat_buff ) != ERR_SUCCESS ) { err_count ++; @@ -101,6 +102,8 @@ task_status_immed tski_cbk_accero( ) } else { + memcpy( &vreg_ctr[VREG_C_ACC_XL], acc_dat_buff, 6 ); + err_count = 0; // 正常時パス // // 加速度更新&割り込み