From 9da24b9857e2654c4101024086f8c84e7c74e7e1 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Thu, 25 Aug 2022 13:16:37 +0100 Subject: Added avr8 --- md/notes/undefined_c/titles.md | 62 +++++++++++++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/md/notes/undefined_c/titles.md b/md/notes/undefined_c/titles.md index 85a8456..a383b82 100644 --- a/md/notes/undefined_c/titles.md +++ b/md/notes/undefined_c/titles.md @@ -1631,18 +1631,12 @@ rustc main.rs -l lib -L . -o hello -C link-arg="-Wl,-rpath=./" ## Multiplatform -### Cross compile - - - - - ### Different flags - ### Check architecture + ### AArch64 https://snapshots.linaro.org/gnu-toolchain/13.0-2022.08-1/aarch64-linux-gnu/ @@ -1694,22 +1688,58 @@ Hello world arm64 ### AVR8 +AVR is 8bit CPU that is quite popular for hobbiest. As baremetal device its doesnt have full libc support, +and needs some setup before its possible to do basics things with it. -### Emscripten +__avr_echo.c__ +```c +#include -[/writeup/web_assembly_sdl_example.md](/writeup/web_assembly_sdl_example.md) +#define FOSC 16000000UL +#define BAUD 9600 +#define MYUBRR FOSC/16/BAUD-1 -#### Embed in JS +void USART_Init( unsigned int ubrr) +{ + UBRRH = (unsigned char)(ubrr>>8); + UBRRL = (unsigned char)ubrr; + UCSRB = (1< avr_echo.s +avr-objcopy -j .text -O ihex avr_echo.out avr_echo.hex +avrdude -pm16 -cavrispv2 -Pusb -U flash:w:avr_echo.hex +``` + +### Emscripten -## Graphics +[/writeup/web_assembly_sdl_example.md](/writeup/web_assembly_sdl_example.md) + +#### Embed in JS -### SDL2 -### GTK -### OpenGL -### Shaders -### Generate image -- cgit v1.2.3