#pragma GCC push_options //This first two lines of the code is a must!!!1
#pragma GCC optimize ("O0")
#include "stm32c0xx.h"
int main(void)
{
RCC -> IOPENR |= (1UL<<1); // Configure GPIOB
GPIOB -> MODER &=~(3UL<<2); //Clear Pin 1
GPIOB -> MODER |= (1UL<<2); //Set Pin 1 as an output
GPIOB -> OTYPER &=~(1UL<<1); // set PB1 as push pull
GPIOB -> MODER &=~(3UL<<14); // set Pb7 an input
GPIOB -> MODER &=~ (3UL<<20); //Set Pb10 as input
GPIOB ->PUPDR |= (1UL<<15);
GPIOB -> PUPDR |= (1UL<<21);
while (1)
{
if(GPIOB -> IDR&(37UL<<4)== 0x0010)
{
GPIOB -> ODR ^= (1UL);
}
else if (GPIOB -> IDR&(37UL<<4)==0x0040)
{
GPIOB -> ODR &= (1UL);
}
else
{
GPIOB -> ODR &=~(1UL);
}
}
}