Skip to content

Instantly share code, notes, and snippets.

@yamanetoshi
Created April 20, 2014 04:38
Show Gist options
  • Save yamanetoshi/11105171 to your computer and use it in GitHub Desktop.
Save yamanetoshi/11105171 to your computer and use it in GitHub Desktop.
main function
/* main.c - the entry point for the kernel */
#include <stdint.h>
#include "rpi_lib/rpi.h"
#define UNUSED(x) (void)(x)
// kernel main function, it all begins here
void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags) {
init_gpio();
pinMode (22 ,ALT4);
pinMode (4 ,ALT5);
pinMode (27 ,ALT4);
pinMode (25 ,ALT4);
pinMode (24 ,ALT4);
// GPIO16 を H にセット
digitalWrite (16 , HIGH );
// GPIO16 を L にセット
digitalWrite (16 , LOW );
UNUSED(r0);
UNUSED(r1);
UNUSED(atags);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment