 #include <EEPROM.h>
 #include <Wire.h>
 
-// --------------------------------------
-//   Version Information
-// --------------------------------------
-#define VERSION 0x0001
-
-#define INTERVAL_TIME   60*15   // default interval : 15min
-
-// --------------------------------------
-//   EEPROM defenision
-// --------------------------------------
-//    00h              -- Version. if 0xff, value is not set.
-//    01h              -- Power On Mode : 0 - auto power off / 1 : auto power on  
-//    02h/03h/04h/05h  -- Interval Timer Count
-//    06h              -- GPIO0 Setting 0:Out / 1:In / 2:In-Pullup
-//    07h              -- GPIO1 Setting 0:Out / 1:In / 2:In-Pullup
-//    08h              -- GPIO2 Setting 0:Out / 1:In / 2:In-Pullup
-//    09h              -- GPIO3 Setting 0:Out / 1:In / 2:In-Pullup
-
-// ---------------------------------------
-//     for I2C
-// ---------------------------------------
-#define I2C_SLAVE_ADDRESS   8
-
-
-// ---------------------------------------
-//     for UART
-// ---------------------------------------
-#define UART_BAUDRATE     115200
-
-// ---------------------------------------
-//     ピン定義
-// ---------------------------------------
-#define TSUBUTA_UART_RXD  0     //  PD0
-#define TSUBUTA_UART_TXD  1     //  PD1
-
-#define TSUBUTA_RPIPOWER  3     //  PD3 (O)  Raspberry Pi Power On/Off
-#define TSUBUTA_GPI_POFF  4     //  PD4 (I) Shutdown signal from Raspberry Pi
-
-#define TSUBUTA_GPIO0     5     //  PD5  PWM
-#define TSUBUTA_GPIO1     6     //  PD6  PWM
-#define TSUBUTA_GPIO2     7     //  PD7
-#define TSUBUTA_GPIO3     8     //  PB0
-
-#define TSUBUTA_RPI_INT   9     //  PB1 (O) Interrupt signal to Raspberry Pi 
-#define TSUBUTA_RTC_INT   10    //  PB2 (I) Interrupt signal from DS1307(RTC Clock)
-
-#define TSUBUTA_AD0       0     //  PC0
-#define TSUBUTA_AD1       1     //  PC1
-#define TSUBUTA_AD2       2     //  PC2
-#define TSUBUTA_AD3       3     //  PC3
-
-#define LED_PIN     13
-
-// ------- Command
-#define COMMAND_GETINFO           0x00
-#define COMMAND_SETINTERVALTIME   0x01
-#define COMMAND_POWEROFF          0x02
-#define COMMAND_LOAD_SETTING      0x0E
-#define COMMAND_SAVE_SETTING      0x0F
-
-#define COMMAND_SETGPIO1          0x10
-#define COMMAND_SETGPIO2          0x11
-#define COMMAND_SETGPIO3          0x12
-#define COMMAND_SETGPIO4          0x13
-
-#define COMMAND_SET_GPO1          0x20
-#define COMMAND_SET_GPO2          0x21
-#define COMMAND_SET_GPO3          0x22
-#define COMMAND_SET_GPO4          0x23
-
-#define COMMAND_GET_GPI1          0x30
-#define COMMAND_GET_GPI2          0x31
-#define COMMAND_GET_GPI3          0x32
-#define COMMAND_GET_GPI4          0x33
-
-#define COMMAND_GET_ADC1          0x40
-#define COMMAND_GET_ADC2          0x41
-#define COMMAND_GET_ADC3          0x42
-#define COMMAND_GET_ADC4          0x43
-
-#define COMMAND_UNKNOWN           0xFF
-
-
 // ------- for Standby mode
 #ifndef cbi
 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))

      if ( (g_RcvCmd.cParamLen = GetCmdParamLen(g_RcvCmd.ucCmd)) >= 0 ) {
        g_RcvCmd.cLen = 0;
      }
      if ( g_RcvCmd.cParamLen == 0x00 ) {
        Serial.println("Parse command");
        ParseCommand((RCVCMD *)&g_RcvCmd);


volatile RCVCMD g_RcvCmd;

const COMMAND_TABLE   g_cCommandInfo[] = {
  { 0x00 , 0x01 , true },     // Get Baord Information 
  { 0x01 , 0x05 , false },    // Set Interval Timer |
  { 0x02 , 0x01 , false },    // RPi Power Off |
  { 0x10 , 0x01 , true },    // RPi Power Off |
  { 0x11 , 0x01 , true },    // RPi Power Off |
  { 0x12 , 0x01 , true },    // RPi Power Off |
  { 0xFF , 0xFF, false },   
};


// ====================================================
