void _initialize_ev3api_motor()

in ev3-api/src/ev3api_motor.c [139:155]


void _initialize_ev3api_motor() {
	// TODO: Thread safe
	assert(pMotorData == NULL);
	if (pMotorData == NULL) {
		mts[EV3_PORT_A]   = NONE_MOTOR;
		mts[EV3_PORT_B]   = NONE_MOTOR;
		mts[EV3_PORT_C]   = NONE_MOTOR;
		mts[EV3_PORT_D]   = NONE_MOTOR;
		brickinfo_t brickinfo;
		ER ercd = fetch_brick_info(&brickinfo);
		assert(ercd == E_OK);
		pMotorReadyStatus = brickinfo.motor_ready;
		pMotorData        = brickinfo.motor_data;
		assert(pMotorData != NULL);
		assert(pMotorReadyStatus != NULL);
	}
}