mirror of
https://github.com/ayabusa/Numworks-zeta-os.git
synced 2025-03-12 16:01:10 +00:00
21 lines
464 B
Plaintext
21 lines
464 B
Plaintext
#include "main.h"
|
|
|
|
/* Main program. */
|
|
int main(void) {
|
|
// Enable the GPIOa and GPIOC peripheral in RCC.
|
|
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOBEN ;
|
|
|
|
// C0 is connected to the LED
|
|
// It should be set to push-pull low-speed output.
|
|
GPIOB->MODER &= ~(0x3 << (LED_PIN*2));
|
|
GPIOB->MODER |= (0x1 << (LED_PIN*2));
|
|
GPIOB->OTYPER &= ~(1 << LED_PIN);
|
|
|
|
// set the led on
|
|
GPIOB->ODR = (1 << LED_PIN);
|
|
while (0)
|
|
{
|
|
GPIOB->ODR = (1 << LED_PIN);
|
|
}
|
|
|
|
} |