// 显示边框 void EntityObjectVisible::showBorder(bool show) { delayInit(); m_showBorder = show; if(m_entityBorder) { m_entityBorder->setVisible(show); } }
// 显示实体 void EntityObjectVisible::showEntity(bool show) { delayInit(); m_showEntity = show; if(m_alphaController) { m_object->getOgreEntity()->setVisible(show); m_alphaController->setTransparency(1.0f); } }
void boardInit(void) { SystemCoreClockUpdate(); delayInit(); GPIOInit(); #ifdef CFG_PRINTF_UART uartInit(CFG_UART_BAUDRATE); #endif /* Set user LED pin to output and disable it */ LPC_GPIO->DIR[CFG_LED_PORT] |= (1 << CFG_LED_PIN); boardLED(CFG_LED_OFF); /* Start Chibi */ #ifdef CFG_CHIBI /* You may need to write a new address to EEPROM if it doesn't exist */ // uint16_t nodeaddr = 0xCAFE; // uint64_t ieeeaddr = 0x123456780000CAFE; // writeEEPROM((uint8_t*)CFG_EEPROM_CHIBI_NODEADDR, (uint8_t*)&nodeaddr, sizeof(nodeaddr)); // writeEEPROM((uint8_t*)CFG_EEPROM_CHIBI_IEEEADDR, (uint8_t*)&ieeeaddr, sizeof(ieeeaddr)); chb_init(); #endif /* Initialise USB */ #ifdef CFG_USB delay(500); usb_init(); #endif /* Initialise the LCD if requested */ #ifdef CFG_TFTLCD lcdInit(); #endif /* Start the command line interface */ #ifdef CFG_INTERFACE cliInit(); #endif /* Initialise the CC3000 WiFi module and connect to an AP */ #ifdef CFG_CC3000 /* Setup the CC3000 pins */ LPC_IOCON ->TRST_PIO0_14 &= ~0x07; LPC_IOCON ->TRST_PIO0_14 |= 0x01; LPC_IOCON ->PIO0_17 &= ~0x07; LPC_IOCON ->PIO0_16 &= ~0x1F; LPC_IOCON ->PIO0_16 |= (1<<4); #endif /* Turn the user LED on after init to indicate that everything is OK */ boardLED(CFG_LED_ON); }
EntityObjectVisible::EntityObjectVisible(EntityObject *obj) : m_object(obj) , m_showBorder(false) , m_showEntity(false) , m_showPlacingEntity(false) , m_scene(0) , m_alphaController(0) , m_collisionEntity(0) , m_entityBorder(0) { m_scene = m_object->getScene(); delayInit(); }
void boardInit(void) { SystemCoreClockUpdate(); delayInit(); GPIOInit(); #ifdef CFG_PRINTF_UART uartInit(CFG_UART_BAUDRATE); #endif /* Set user LED pin to output and disable it */ LPC_GPIO->DIR[CFG_LED_PORT] |= (1 << CFG_LED_PIN); boardLED(CFG_LED_OFF); /* Start Chibi */ #ifdef CFG_CHIBI /* You may need to write a new address to EEPROM if it doesn't exist */ // uint16_t nodeaddr = 0xCAFE; // uint64_t ieeeaddr = 0x123456780000CAFE; // writeEEPROM((uint8_t*)CFG_EEPROM_CHIBI_NODEADDR, (uint8_t*)&nodeaddr, sizeof(nodeaddr)); // writeEEPROM((uint8_t*)CFG_EEPROM_CHIBI_IEEEADDR, (uint8_t*)&ieeeaddr, sizeof(ieeeaddr)); chb_init(); #endif /* Initialise USB */ #ifdef CFG_USB delay(500); usb_init(); #endif /* Initialise the LCD if requested */ #ifdef CFG_TFTLCD lcdInit(); #endif /* Start the command line interface */ #ifdef CFG_INTERFACE cliInit(); #endif /* Start CC3000 WiFi Module */ #ifdef CFG_CC3000 // ToDo: Make sure CC3000 pins are multiplexed to the correct function // since the init code only sets gpio dir, etc. // ToDo: Init anything else required for the CC3000! #endif /* Turn the user LED on after init to indicate that everything is OK */ boardLED(CFG_LED_ON); }
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 EntityObjectVisible::showPlacingEntity(bool show) { delayInit(); m_showPlacingEntity = show; if(m_alphaController) { if(show) { m_object->getOgreEntity()->setVisible(true); m_alphaController->setTransparency(0.5f); } else { showEntity(isShowEntity()); } } }
int main(void) { /* Initialise the Due board */ sysclk_init(); board_init(); delayInit(); daccInit(); analogInit(1); if (xTaskCreate(task_PID, (const signed char * const) "Task_PID", TASK_STACK_PID_SIZE, NULL, TASK_PID_STACK_PRIORITY, NULL) != pdPASS) { printf("Failed to create PID task\r\n"); } /* if (xTaskCreate(task_Matlab, (const signed char * const) "Task_Matlab", TASK_STACK_MATLAB_SIZE, NULL, TASK_MATLAB_STACK_PRIORITY, NULL) != pdPASS) { printf("Failed to create Matlab task\r\n"); }*/ vTaskStartScheduler(); }