示例#1
0
文件: main.c 项目: damagigo/Thesis
void PermanentBlinkTask(void const *argument)
{
	UNUSED(argument);

	uartWriteLine("SatisFactory Permanent Blink Task\n");

	while(1) {

		SetRGBLed(ORANGE,70);
		osDelay(500);
		SetRGBLed(REDMAGENTA,0);
		osDelay(500);

		//uartWriteLine("UART Test\n");

	}
}
void LedControl::SetRGBBackground(const Color& color)
{
	for(uint8_t led = 0; led < NUM_LEDS; ++led)
		SetRGBLed(led, color);
}
示例#3
0
文件: main.c 项目: damagigo/Thesis
int main(void){

	//uint8_t mpuWhoAmI[1];
	//char outString[MAX_UART_STRING_LENGTH];

	/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
	HAL_Init();

	/* Configure the system clock */
	SystemClock_Config();

	/* Initialize all configured peripherals */
	//MX_RTC_Init();
	MX_DMA_Init();
	MX_GPIO_Init();

	MX_UART2_Init();
	MX_SPI3_Init();
	//MX_I2C1_Init();

	MX_TIM1_Init();

	//decaPeripheralInit();


	SetRGBLed(RED, 50);

	/* Test UART Transmit without semaphores */
	uartWriteLineNoOS("SatisFactory MPU9250 no OS Test\n");

	/* Create the threads and semaphore */
	//osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 512);
	//defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);

	osThreadDef(permanentBlinkTask, PermanentBlinkTask, osPriorityNormal, 0, 128);
	permanentBlinkTaskHandle = osThreadCreate(osThread(permanentBlinkTask), NULL);

	//osThreadDef(permanentBlinkTask2, PermanentBlinkTask, osPriorityNormal, 0, 128);
	//permanentBlinkTaskHandle2 = osThreadCreate(osThread(permanentBlinkTask2), 200);

	osThreadDef(uwbInitTask, UwbInitTask, osPriorityNormal, 0, 512); //128
	uwbInitTaskHandle = osThreadCreate(osThread(uwbInitTask), NULL);

	//osThreadDef(readI2CTask, ReadI2CTask, osPriorityNormal, 0, 512); //128
	//readI2CTaskHandle = osThreadCreate(osThread(readI2CTask), NULL);

	/* Start scheduler */
	osKernelStart();

	//StartDefaultTask(NULL);
	//StartUWBTask(NULL);
	//StartMPUTask(NULL);
	//ReadI2CTask(NULL);

	/* We should never get here as control is now taken by the scheduler */


	/* Infinite loop */
	while (1){
		//RGBLedFade(1);
	}

}