Пример #1
0
int main(void)
{

	/* USER CODE BEGIN 1 */

	/* USER CODE END 1 */

	/* MCU Configuration----------------------------------------------------------*/

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

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

	/* Initialize all configured peripherals */
	MX_GPIO_Init();
	MX_USART1_UART_Init();
	MX_SPI1_Init();
	MX_TIM1_Init();
	MX_TIM3_Init();

	HAL_TIM_Base_Start(&htim1);

	static char buf[50];


	NRF24L01_Reset();
	NRF24L01_Initialize();
	HAL_Delay(150);


	CX10_init();
	HAL_Delay(50);
	CX10_bind();

	while (1) {
		process_CX10();
		HAL_Delay(6);
	}

}
Пример #2
0
void init_protocol()
{
    switch(current_protocol) {
        case PROTO_CG023:
        case PROTO_YD829:
            CG023_init();
            CG023_bind();
            break;
        case PROTO_V2X2:
            V2x2_init();
            V2x2_bind();
            break;
        case PROTO_CX10_GREEN:
        case PROTO_CX10_BLUE:
            CX10_init();
            CX10_bind();
            Serial.println("cx10-init and bind");
            break;
        case PROTO_H7:
            H7_init();
            H7_bind();
            break;
        case PROTO_BAYANG:
            Bayang_init();
            Bayang_bind();
            break;
        case PROTO_SYMAX5C1:
            Symax_init();
            SymaX_bind();
            break;
        case PROTO_H8_3D:
            H8_3D_init();
            H8_3D_bind();
            break;
    }
}