int THmonitoring_init() { //LED if ((exportGPIOPin(LEDpin)) == -1) { printf("exportGPIOPin(%d) failed\n", LEDpin); return -1; } if ((setGPIODirection(LEDpin, GPIO_OUT)) == -1) { printf("setGPIODirection(%d) failed\n", LEDpin); return -1; } //LCD if ((devFD_LCD = LCD1602Init()) == -1) { printf("Fail to init LCD1602\n"); return -1; } if (LCD1602Clear(devFD_LCD) == -1) { printf("Fail to Clear\n"); return -1; } //dht11 if ((devFD_DHT11 = dht11Init(DHT11pin)) == -1) { printf("Fail to init dht11\n"); return -1; } return 0; }
void userInit(void) { delayInit(72); uartxInit(); rgbLedInit(); ledGpioInit(); rgbKeyGpioInit(); motorInit(); dht11Init(); irInit(); watchdogInit(2); //5,625看门狗复位时间2s memset((uint8_t*)&reportData, 0, sizeof(gizwitsReport_t)); reportData.devStatus.Motor_Speed = protocolExchangeBytes(Y2X(MOTOR_SPEED_RATIO,MOTOR_SPEED_ADDITION,MOTOR_SPEED_DEFAULT)); motorStatus(MOTOR_SPEED_DEFAULT); }
void protocol_init(void) { pilightFirmwareInit(); #if defined(PROTOCOL_COCO_SWITCH) || defined(PROTOCOL_DIO_SWITCH) || defined(PROTOCOL_NEXA_SWITCH) || defined(PROTOCOL_KAKU_SWITCH) || defined(PROTOCOL_INTERTECHNO_SWITCH) arctechSwInit(); #endif #ifdef PROTOCOL_KAKU_SCREEN arctechSrInit(); #endif #ifdef PROTOCOL_KAKU_CONTACT arctechContactInit(); #endif #ifdef PROTOCOL_KAKU_DIMMER arctechDimInit(); #endif #if defined(PROTOCOL_COGEX_SWITCH) || defined(PROTOCOL_KAKU_SWITCH_OLD) || defined(PROTOCOL_INTERTECHNO_OLD) arctechSwOldInit(); #endif #ifdef PROTOCOL_KAKU_SCREEN_OLD arctechSrOldInit(); #endif #ifdef PROTOCOL_HOMEEASY_OLD homeEasyOldInit(); #endif #if defined(PROTOCOL_ELRO_SWITCH) || defined(PROTOCOL_BRENNENSTUHL_SWITCH) elroHEInit(); elroHCInit(); #endif #if defined(PROTOCOL_SELECTREMOTE) || defined(PROTOCOL_IMPULS) impulsInit(); #endif #ifdef PROTOCOL_RELAY relayInit(); #endif #ifdef PROTOCOL_RAW rawInit(); #endif #ifdef PROTOCOL_REV revInit(); #endif #ifdef PROTOCOL_ALECTO alectoInit(); #endif #ifdef PROTOCOL_GENERIC_WEATHER genWeatherInit(); #endif #ifdef PROTOCOL_GENERIC_SWITCH genSwitchInit(); #endif #ifdef PROTOCOL_GENERIC_DIMMER genDimInit(); #endif #ifdef PROTOCOL_DS18B20 ds18b20Init(); #endif #ifdef PROTOCOL_DS18S20 ds18s20Init(); #endif #ifdef PROTOCOL_DHT22 dht22Init(); #endif #ifdef PROTOCOL_DHT11 dht11Init(); #endif #ifdef PROTOCOL_CLARUS clarusSwInit(); #endif #ifdef PROTOCOL_RPI_TEMP rpiTempInit(); #endif #ifdef PROTOCOL_CONRAD_RSL_SWITCH conradRSLSwInit(); #endif #ifdef PROTOCOL_CONRAD_RSL_CONTACT conradRSLCnInit(); #endif #if defined(PROTOCOL_LM75) || defined(PROTOCOL_LM76) lm75Init(); lm76Init(); #endif #ifdef PROTOCOL_POLLIN_SWITCH pollinInit(); #endif #ifdef PROTOCOL_MUMBI_SWITCH mumbiInit(); #endif #ifdef PROTOCOL_WUNDERGROUND wundergroundInit(); #endif #ifdef PROTOCOL_OPENWEATHERMAP openweathermapInit(); #endif #ifdef PROTOCOL_SILVERCREST silvercrestInit(); #endif #ifdef PROTOCOL_FUKANG fukangInit(); #endif }