# Problem Create a program that does the following: Read the status of the switches and buttons by reading Port C and writing to Port D. Once you have it working in the correct order, use the `__RBIT()` macro to reverse the bit order between the switches and the LEDs. Note that you will need to use bit shifting to present the reversed but order correctly to the output register. # Process ... # Answer ```c int main(void) { /* Reset 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_I2C1_Init(); MX_I2S3_Init(); MX_SPI1_Init(); MX_USB_HOST_Init(); MX_TIM7_Init(); /* Configure GPIOs. */ GPIOD->MODER = 0x55555555; GPIOC->MODER |= 0x0; /* Infinite loop. */ while (1) { /* Set output LEDs to the states of the input switches */ /* GPIOD->ODR = GPIOC->IDR; */ /* Set output LEDs to the states of the input switches in reverse order. */ GPIOD->ODR = __RBIT(GPIOC->IDR) >> 16; MX_USB_HOST_Process(); } } ```