From 603d04992cbf6c02cfc16f06ffab7d014d817634 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 25 Mar 2018 21:16:33 -0400 Subject: [PATCH] added licensing --- LICENSE | 9 +- Makefile | 20 ++++ README.md | 15 ++- include/clock.h | 17 ++- include/display.h | 41 ++++++- include/display_draw.h | 15 +++ include/flash.h | 38 ++++++ include/gpio.h | 15 +++ include/heap.h | 15 +++ include/initrd.h | 25 +++- include/keypad.h | 32 +++++ include/lcd.h | 15 +++ include/random.h | 15 +++ include/script.h | 17 ++- include/serial.h | 15 +++ include/stdlib.h | 43 +++++++ include/task.h | 24 +++- initrd/init3 | 1 - initrd/{init2 => keys} | 0 initrd/lines | 29 +++++ libinterp.a | Bin 47524 -> 47938 bytes link.ld | 244 +++++++++++++------------------------- run.sh | 19 +++ src/clock.c | 20 ++++ src/display.c | 20 ++++ src/display_draw.c | 21 ++++ src/flash.c | 20 ++++ src/flash.c.bak | 110 +++++++++++++++++ src/gpio.c | 20 ++++ src/heap.c | 20 ++++ src/initrd.c | 23 ++++ src/keypad.c | 20 ++++ src/keypad.c.bak | 20 ++++ src/lcd.c.bak | 20 ++++ src/main.c | 24 +++- src/random.c | 20 ++++ src/script.c | 52 +++++++- src/serial.c | 20 ++++ src/startup_stm32l476xx.s | 10 +- src/stdlib.c | 22 ++++ src/task.c | 20 ++++ xinitrd/init | 33 ------ xinitrd/init2 | 21 ---- 43 files changed, 950 insertions(+), 250 deletions(-) delete mode 100644 initrd/init3 rename initrd/{init2 => keys} (100%) create mode 100644 initrd/lines create mode 100644 src/flash.c.bak delete mode 100644 xinitrd/init delete mode 100644 xinitrd/init2 diff --git a/LICENSE b/LICENSE index 94a9ed0..53d1f3d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,12 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. + diff --git a/Makefile b/Makefile index b5b2f21..0b9e19a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,23 @@ +## +# @file Makefile +# Script to build source files +# +# Copyright (C) 2018 Clyne Sullivan +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + CROSS = arm-none-eabi- CC = gcc AS = as diff --git a/README.md b/README.md index f2e4a04..60b714d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # calculator -An OS for an STM32-based calculator +A from-scratch operating system for a graphing calculator. -Trying to make an operating system for a calculator based on the STM32L476RG, using its associated Nucleo board. Starting from scratch because it's fun. +The goal of this project is to design a functional operating system for a +graphing calculator based on the STM32L476RG processor. This OS has been +designed from scratch to optimize for speed and code size, targeting the +features necessary for a graphing calculator application. Required packages: * arm-none-eabi toolchain @@ -10,4 +13,10 @@ Required packages: Use ```run.sh``` to upload the final output to the processor. -To make an initrd, add files to ```initrd/``` and then run ```./mkinitrd.sh```. + +## design overview +The core of the operating system is written entirely in C and assembly. This +project is paired with the [interpreter project](https://code.bitgloo.com/clyne/interpreter) +(licensed under the GPL), +which parses script from C strings. The operating system exposes calls to the +script parser, and then loads the text file at ```initrd/init```. diff --git a/include/clock.h b/include/clock.h index c12c41e..7446dd1 100644 --- a/include/clock.h +++ b/include/clock.h @@ -1,6 +1,21 @@ /** * @file clock.h * Basic clock utilities + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef CLOCK_H_ @@ -9,7 +24,7 @@ #include /** - * Sets HCLK (system clock) to 80MHz, the maximum. + * Initializes clocks, setting HCLK (system clock) to 80MHz, the maximum. */ extern void clock_init(void); diff --git a/include/display.h b/include/display.h index 55f6974..b8afe38 100644 --- a/include/display.h +++ b/include/display.h @@ -1,6 +1,21 @@ /* * @file display.h - * Display library for ILI9481 display. + * Display library for ILI9481 display + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef DISPLAY_H_ @@ -18,6 +33,11 @@ */ #define LCD_HEIGHT 320 +/** + * Initializes the display. Must be called before other display use. + */ +void dsp_init(void); + /** * Returns the color integer for the given RGB values. * Converts 8RGB to 5-6-5. @@ -52,9 +72,24 @@ void dsp_write_data(uint8_t data); */ uint8_t dsp_read_data(void); +/** + * Selects the area of pixels to draw to, from (x1, y1) inclusive to (x2, y2) + * exclusive. + * @param x1 starting x coordinate + * @param y1 starting y coordinate + * @param x2 ending x coordinate + * @param y2 ending y coordinate + */ void dsp_set_addr(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); -void dsp_set_addr_read(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); -void dsp_init(void); +/** + * Selects the area of pixels to read from, in the range (x1, y1) inclusive to + * (x2, y2) exclusive. + * @param x1 starting x coordinate + * @param y1 starting y coordinate + * @param x2 ending x coordinate + * @param y2 ending y coordinate + */ +void dsp_set_addr_read(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2); #endif // DISPLAY_H_ diff --git a/include/display_draw.h b/include/display_draw.h index 9d86437..8db3e2c 100644 --- a/include/display_draw.h +++ b/include/display_draw.h @@ -1,6 +1,21 @@ /** * @file display_draw.h * Provides functions for drawing to the display + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef DISPLAY_DRAW_H_ diff --git a/include/flash.h b/include/flash.h index 26fffd3..47daf8e 100644 --- a/include/flash.h +++ b/include/flash.h @@ -1,11 +1,49 @@ +/** + * @file flash.h + * Provides functionality for using an external SPI flash + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef FLASH_H_ #define FLASH_H_ #include +/** + * Initializes GPIO ports and variables for flash IO. Must be called before + * any reads or writes. + */ void flash_init(void); +/** + * Does a blocking read of the flash chip into a pre-allocated buffer. + * @param buf the buffer to read in to + * @param addr the address to read from in the flash chip + * @param count the number of bytes to read from the chip + */ void flash_read(char *buf, uint32_t addr, unsigned int count); + +/** + * Does a blocking write to the flash chip using data from a pre-allocated + * buffer. + * @param buf the buffer to read data from + * @param addr the address to write to in the flash chip + * @param count the number of bytes to write to the chip + */ void flash_write(const char *buf, uint32_t addr, unsigned int count); #endif // FLASH_H_ diff --git a/include/gpio.h b/include/gpio.h index 46a8e15..58ebaa7 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -1,6 +1,21 @@ /** * @file gpio.h * Abstracts gpio access, makes things easier + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef GPIO_H_ diff --git a/include/heap.h b/include/heap.h index e8cd9c1..593ce09 100644 --- a/include/heap.h +++ b/include/heap.h @@ -1,6 +1,21 @@ /** * @file heap.h * A basic memory manager + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef HEAP_H_ diff --git a/include/initrd.h b/include/initrd.h index de730f2..7bc34bb 100644 --- a/include/initrd.h +++ b/include/initrd.h @@ -4,6 +4,21 @@ * An archive file (made with ar) can be linked into the final executable to * allow files to be loaded in memory on boot. See mkinitrd.sh or the Makefile * for more info. + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef INITRD_H_ @@ -16,7 +31,7 @@ */ typedef struct { - char signature[8]; /**< The archive's signature. */ + char signature[8]; /**< The archive's signature */ } __attribute__ ((packed)) initrd_header; /** @@ -24,10 +39,10 @@ typedef struct */ typedef struct { - char name[16]; /**< The name of the file. */ - uint8_t unused[32]; /**< Unused information. */ - char size[10]; /**< The file's size in bytes (as string). */ - char sig[2]; /**< A signature to start file data. */ + char name[16]; /**< The name of the file */ + uint8_t unused[32]; /**< Unused information */ + char size[10]; /**< The file's size in bytes (as string) */ + char sig[2]; /**< A signature to start file data */ } __attribute__ ((packed)) initrd_file; /** diff --git a/include/keypad.h b/include/keypad.h index 5eec1fc..2e5fa9c 100644 --- a/include/keypad.h +++ b/include/keypad.h @@ -1,3 +1,23 @@ +/** + * @file keypad.h + * Manages the GPIO keypad + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef KEYPAD_H_ #define KEYPAD_H_ @@ -16,9 +36,21 @@ #define KS (uint16_t)(1 << 10) #define KP (uint16_t)(1 << 11) +/** + * Initializes GPIO for the keypad. Must be called before any keypad reading. + */ void keypad_init(void); +/** + * Reads the state of the keypad and returns it. + * @return the keypad's state + */ uint16_t keypad_get(void); + +/** + * Tests if the given key is currently pressed, returning non-zero if it is. + * @return non-zero if pressed + */ uint8_t keypad_isdown(uint16_t); #endif // KEYPAD_H_ diff --git a/include/lcd.h b/include/lcd.h index 378aac4..c13ff97 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -1,6 +1,21 @@ /** * @file lcd.h * A basic library for writing a 16x2 text LCD. + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef LCD_H_ diff --git a/include/random.h b/include/random.h index a1868f6..efb3726 100644 --- a/include/random.h +++ b/include/random.h @@ -1,6 +1,21 @@ /** * @file random.h * Provides true random number generation functionality + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef RANDOM_H_ diff --git a/include/script.h b/include/script.h index ab5fa7e..971cccf 100644 --- a/include/script.h +++ b/include/script.h @@ -1,6 +1,21 @@ /** * @file script.h * Provides script library for using calculator hardware + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef SCRIPT_H_ @@ -9,7 +24,7 @@ #include /** - * Loads the library for the given interpreter. + * Loads the library for the given interpreter instance. * @param it the interpreter to use */ void script_loadlib(instance *it); diff --git a/include/serial.h b/include/serial.h index 7192e17..b943c33 100644 --- a/include/serial.h +++ b/include/serial.h @@ -1,6 +1,21 @@ /** * @file serial.h * Provides basic serial IO (through STM debug stuff) + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef SERIAL_H_ diff --git a/include/stdlib.h b/include/stdlib.h index c2658d6..ada39cd 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -1,8 +1,51 @@ +/** + * @file stdlib.h + * Provides missing C standard library functions + * The newlib versions of these calls are not being used due to dependence on + * unsupported system calls. + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #ifndef STDLIB_H_ #define STDLIB_H_ +/** + * Parses a formatted string, storing the result in the given buffer. + * @param buf the buffer to print the parsed string to + * @param max the maximum number of bytes to write to the buffer + * @param format the format string + * @return a pointer to the buffer + */ char *snprintf(char *buf, unsigned int max, const char *format, ...); + +/** + * Attempts to convert the given string to a float. + * @param s the string to convert + * @param endptr if not-null, set to the address of the character after the + * number + * @return the resulting float, or zero if an error occurred + */ float strtof(const char *s, char **endptr); + +/** + * Attempts to convert the given string to an integer. + * @param s the string to convert + * @return the resulting integer, or zero if an error occurred + */ int atoi(const char *s); #endif // STDLIB_H_ diff --git a/include/task.h b/include/task.h index 6456bdc..555a470 100644 --- a/include/task.h +++ b/include/task.h @@ -1,6 +1,21 @@ /** * @file task.h * Provides multitasking functionality + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #ifndef TASK_H_ @@ -8,10 +23,13 @@ #include +/** + * A structure to contain task data. + */ typedef struct { - void *next; - uint32_t *stack; - uint32_t *sp; + void *next; /**< pointer to the next task_t instance */ + uint32_t *stack; /**< pointer to the task's stack */ + uint32_t *sp; /**< pointer to the task's last sp register value */ } task_t; /** diff --git a/initrd/init3 b/initrd/init3 deleted file mode 100644 index 4351743..0000000 --- a/initrd/init3 +++ /dev/null @@ -1 +0,0 @@ -print "Hello, world!" diff --git a/initrd/init2 b/initrd/keys similarity index 100% rename from initrd/init2 rename to initrd/keys diff --git a/initrd/lines b/initrd/lines new file mode 100644 index 0000000..f6b2a82 --- /dev/null +++ b/initrd/lines @@ -0,0 +1,29 @@ +print("Hello.\n") + +fg = 32767 + +# draw bg, lines +rect(50, 50, 380, 220, 6375) +line(50, 160, 430, 160, fg) +line(240, 50, 240, 270, fg) + +x = 50 +while (x <= 430) { + line(x, 170, x, 150, fg) + x = x + 20 +} + +y = 50 +while (y <= 270) { + line(230, y, 250, y, fg) + y = y + 20 +} + +while (1) { + x = rand(379) + 50 + y = rand(219) + 50 + i = 50 + rand(379) + j = 50 + rand(219) + + line(x, y, i, j, 511) +} diff --git a/libinterp.a b/libinterp.a index 08b52ec23cbc7f0e5e674450c45c3f684d5dd819..123d9f418c141931bf4de8feec44f22e84b421e5 100644 GIT binary patch delta 12090 zcmcIqdt8)N-aqG=8NeAJ6h%}Vfl)3qgAU*YK@<#cU}j~7rg4eOfTOUAhEhIwsjPL= z@tA8$Nm;H|URGR1v9fmC+O`XpW$$)*$xD~b{j8N0if_H&-+9g;y6?Mxz3+TJJiq(( z{LXovd6;Lu*IxZm+b}37&675I)F^*kv_2{$*7y`#8Dpau(?0z7f9|7<{a^i+j4orW zWc2^{UrRK%bCa)Xq3~#12C>p5Rld5ag^P#RjF6?Lj!HB7F;a{#iE8Q8E}HbX1L#Ij z1vAG>q?VZ->%d`}*?g~wvEUH%;4Y9MbqgS}uLR0@FzYo3hSTDoK5=SVr?t-Evem`)t zH7p3Y;|<^;)*YlXloAZJK0)}fcfgOZHY2_zf%tvH7M0gAOCtG+ww@rJq?O>uSid4X znef3Z+)PDcBq- zQ_WwNw3zV+DVXN3ORA{__0UO4)h3lN{%b?xV+j+;d?`80gR{BP+4_L9rG_(Kl3u}h zz4FEqj-YeAoNPXUORuzfFJM!yY=+H(j8`h7VUg$-_fi#_zm_HJBct2NMH$rUrHdgp zRm1Ipu#2lI8NU-oVpi|S$#(^;SwaVLH;R>yCme|v~ zzdP$1mF#Ph93Kdi&`cGiiVMB_k53Jxw6tUqBn@Ek1WA^7fWqDR=eycY}ZTzZv`+5wOSL z+o0NG@Eyprd+_704*qYi8+^gUnbGMyLG&M!$XzWH#taV8)7024q~bCSBJn3O{4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?-H}X9~8!pOzpHTUfYq5UuRz3;pP*?m$)~HgcdhH zDMsL)Dz3r3S{S%b6uWS55ihl5dcu$KqPUn1x*0T!g8n`(20_i`OkrC^@B1n2xcf7c z!>>^hm=+F@exGQ%|1E=lm^3fW=;e(zs<2EYLr=u8OnQ3WhGo*<6(N(J9_{AE8R@6u zK@*lqPhAMh(7V}goNK}jWI!jUuuKjD(c*+FS;X&3H0Z1wsd^0c9hM3DLWE4v&vDc- zFSBpwB4pAx(LNzBQ@<%fCjB|=Y37A#W=wqHa*BPs9^^%0)&n0IH23k0vp+&ri&67| zl1zu6?T~46BKaxM4#@NvBKZZ-Gmz;iNAeq>_hZx^Q}S`pK9*nfA3>f3d8E>R3A)aL zeU!FGa?lC-5e(?4K(dC!($r~#}H~a7<*31-wl(A-NpUBv0YKK3DVIdrS1tq&NL@zOyj#iBGY6Ue+#)mSZ=utCKWZFq|9Air` zmX0ad>xm+8GRBhRtBFoUB3K-bX?V3JT7YLUQB+GF-jW~`O5ryG9MA3ed=upOfBwBt$h z=M<$KfC3!`CA+tYVhTP{bWI|bEzQMFi~zMrCbM1e0+^eU4YtV$U)DcYhCI4N~PgT1GGe`~-6&;{xuA;?6(Sb5WS1Ed@qWg%tQL}$m4Ie1_gQAHj0SeHc zC>%{w^0i7{sc4gGzfI9Ss+~%T@GmR*EhV2))Pj=I3^?vb3}}v`lZd7DKR|D|LL)h6s>iNa5clJk^Y1Zt4MYSpk#8EjPY?MmLG=nJa-u#!Jj za;K8Jp|&YdAENM^rQ|#%PgC+NC1cUxj1NGaQmj|>NkyMkhG&%gjgtFfQ4nq*Q3RT% z{oK7 zk{2oYcS`2B3-9BPjw;1-O&f^CLKN@~O5UX8RwdK_v6B9nlHV2yPuw^HK z@5$2h4?kaFLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(8); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(8); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(8); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(8); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(8); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(8); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - *(._user_heap_stack) - . = ALIGN(8); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - +/** + * @file linker.ld + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* enter at the reset handler */ +ENTRY(Reset_Handler) + +/* description of memory regions */ +MEMORY { + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 96K +} + +/* description of ELF sections */ +SECTIONS { + /* keep startup code at beginning */ + .isr_vector : { + . = ALIGN(8); + KEEP(*(.isr_vector)) + . = ALIGN(8); + } > FLASH + + /* code sections */ + .text : { + . = ALIGN(8); + *(.text) + . = ALIGN(8); + } > FLASH + + /* readonly data */ + .rodata : { + . = ALIGN(8); + *(.rodata) + . = ALIGN(8); + } > FLASH + + /* init_array/fini_array (TODO understand this) */ + .init_array : { + PROVIDE_HIDDEN(__init_array_start = .); + KEEP(*(.init_array)) + PROVIDE_HIDDEN(__init_array_end = .); + } > FLASH + + .fini_array : { + PROVIDE_HIDDEN(__fini_array_start = .); + KEEP(*(.fini_array)) + PROVIDE_HIDDEN(__fini_array_end = .); + } > FLASH + + /* initialized data */ + _sidata = LOADADDR(.data); + .data : { + . = ALIGN(8); + _sdata = .; + *(.data) + . = ALIGN(8); + _edata = .; + } > RAM AT > FLASH + + /* uninitialized data */ + .bss : { + . = ALIGN(8); + __bss_start__ = .; + *(.bss) + __bss_end__ = .; + } > RAM +} diff --git a/run.sh b/run.sh index f628d56..79b7c7e 100755 --- a/run.sh +++ b/run.sh @@ -1,4 +1,23 @@ #!/bin/bash +# +# @file run.sh +# Starts openocd and connects gdb to the target, for programming/debugging +# +# Copyright (C) 2018 Clyne Sullivan +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# openocd -f /usr/share/openocd/scripts/board/st_nucleo_l476rg.cfg > /dev/null & gdb-multiarch -iex "target remote localhost:3333" out/main.elf diff --git a/src/clock.c b/src/clock.c index 0c8ca7c..284573c 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,3 +1,23 @@ +/** + * @file clock.c + * Basic clock utilities + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff --git a/src/display.c b/src/display.c index 163a742..e961299 100644 --- a/src/display.c +++ b/src/display.c @@ -1,3 +1,23 @@ +/* + * @file display.c + * Display library for ILI9481 display + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff --git a/src/display_draw.c b/src/display_draw.c index f58dda7..269f76c 100644 --- a/src/display_draw.c +++ b/src/display_draw.c @@ -1,3 +1,23 @@ +/** + * @file display_draw.c + * Provides functions for drawing to the display + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -41,6 +61,7 @@ void dsp_putchar(int c) dsp_rect(0, 0, LCD_WIDTH, LCD_HEIGHT, 0); cury = 0; } + UNLOCK; return; } else if (c == '\b') { if (curx > 0) diff --git a/src/flash.c b/src/flash.c index 6b3ee00..e3de420 100644 --- a/src/flash.c +++ b/src/flash.c @@ -1,3 +1,23 @@ +/** + * @file flash.c + * Provides functionality for using an external SPI flash + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff --git a/src/flash.c.bak b/src/flash.c.bak new file mode 100644 index 0000000..037eeae --- /dev/null +++ b/src/flash.c.bak @@ -0,0 +1,110 @@ +#include +#include +#include + +#define READ 0x03 +#define WRITE 0x02 +#define WREN 0x06 +#define WRDS 0x04 + +#define SCK GPIO_PORT(C, 9) +#define SI GPIO_PORT(B, 8) +#define SO GPIO_PORT(B, 9) +#define CS GPIO_PORT(C, 4) + +void flash_out(uint8_t); +uint8_t flash_in(void); + +void flash_init(void) +{ + gpio_mode(SCK, OUTPUT); + gpio_mode(SI, OUTPUT); + gpio_mode(CS, OUTPUT); + gpio_mode(SO, OUTPUT); + gpio_dout(SO, 0); + gpio_mode(SO, INPUT); + gpio_dout(CS, 1); + gpio_dout(SCK, 0); + gpio_dout(SI, 0); + + //RCC->AHB3ENR |= RCC_AHB3ENR_QSPIEN; + + //// 10MHz operation, per datasheet + //QUADSPI->CR &= ~(0xFF << QUADSPI_CR_PRESCALER_Pos); + //QUADSPI->CR |= 7 << QUADSPI_CR_PRESCALER_Pos; + + //// pick FSEL! 0=1, 1=2 + + //// FSIZE = 16, 2^17 bits = 1Mb + //QUADSPI->DCR = (16 << QUADSPI_DCR_FSIZE_Pos); + + //// Memmap mode, single-spi + //QUADSPI->CCR = (3 << QUADSPI_CCR_FMODE_Pos) | (1 << QUADSPI_CCR_DMODE_Pos) + // | (2 << QUADSPI_CCR_ADSIZE_Pos) | (1 << QUADSPI_CCR_ADMODE_Pos) + // | (1 << QUADSPI_CCR_IMODE_Pos); + //// TODO CCR also takes instruction byte + //QUADSPI->CCR |= (READ << QUADSPI_CCR_INSTRUCTION_Pos); + + //QUADSPI->CR |= QUADSPI_CR_EN; +} + +void flash_out(uint8_t byte) +{ + for (uint8_t i = 0; i < 8; i++) { + gpio_dout(SI, (byte & (1 << (7 - i)))); + gpio_dout(SCK, 1); + gpio_dout(SCK, 0); + } +} + +void flash_addr(uint32_t addr) +{ + for (uint8_t i = 0; i < 24; i++) { + gpio_dout(SI, (addr & (1 << (23 - i)))); + gpio_dout(SCK, 1); + gpio_dout(SCK, 0); + } +} + +uint8_t flash_in(void) +{ + uint8_t byte = 0; + for (uint8_t i = 0; i < 8; i++) { + gpio_dout(SCK, 1); + gpio_dout(SCK, 0); + if (gpio_din(SO)) + byte |= (1 << (7 - i)); + } + return byte; +} + +void flash_read(char *buf, uint32_t addr, unsigned int count) +{ + if (buf == 0) + return; + gpio_dout(CS, 0); + flash_out(READ); + flash_addr(addr); + for (unsigned int i = 0; i < count; i++) + buf[i] = flash_in(); + gpio_dout(CS, 1); +} + +void flash_write(const char *buf, uint32_t addr, unsigned int count) +{ + if (buf == 0) + return; + gpio_dout(CS, 0); + flash_out(WREN); + gpio_dout(CS, 1); + gpio_dout(CS, 0); + flash_out(WRITE); + flash_addr(addr); + for (unsigned int i = 0; i < count; i++) + flash_out(buf[i]); + gpio_dout(CS, 1); + delay(100); + //gpio_dout(CS, 0); + //flash_out(WRDS); + //gpio_dout(CS, 1); +} diff --git a/src/gpio.c b/src/gpio.c index 900a3f1..2e50e88 100644 --- a/src/gpio.c +++ b/src/gpio.c @@ -1,3 +1,23 @@ +/** + * @file gpio.c + * Abstracts gpio access, makes things easier + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include void gpio_init(void) diff --git a/src/heap.c b/src/heap.c index 9a11cba..c2293fa 100644 --- a/src/heap.c +++ b/src/heap.c @@ -1,3 +1,23 @@ +/** + * @file heap.c + * A basic memory manager + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #define HEAP_ALIGN 4 diff --git a/src/initrd.c b/src/initrd.c index 948811f..37e3764 100644 --- a/src/initrd.c +++ b/src/initrd.c @@ -1,3 +1,26 @@ +/** + * @file initrd.c + * Initrd image support + * An archive file (made with ar) can be linked into the final executable to + * allow files to be loaded in memory on boot. See mkinitrd.sh or the Makefile + * for more info. + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include extern uint8_t _binary_initrd_img_start[]; diff --git a/src/keypad.c b/src/keypad.c index 06e0b6a..fad774a 100644 --- a/src/keypad.c +++ b/src/keypad.c @@ -1,3 +1,23 @@ +/** + * @file keypad.c + * Manages the GPIO keypad + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff --git a/src/keypad.c.bak b/src/keypad.c.bak index f25d46f..2fbefff 100644 --- a/src/keypad.c.bak +++ b/src/keypad.c.bak @@ -1,3 +1,23 @@ +/** + * @file keypad.c + * Manages the GPIO keypad using IO expanders + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff --git a/src/lcd.c.bak b/src/lcd.c.bak index a2a8ca7..8229041 100644 --- a/src/lcd.c.bak +++ b/src/lcd.c.bak @@ -1,3 +1,23 @@ +/** + * @file lcd.c + * A basic library for writing a 16x2 text LCD. + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff --git a/src/main.c b/src/main.c index fc64edd..9844199 100644 --- a/src/main.c +++ b/src/main.c @@ -1,3 +1,23 @@ +/** + * @file main.c + * Entry point for operating system + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -15,7 +35,7 @@ #include #include -extern uint8_t _ebss; +extern uint8_t __bss_end__; extern char *itoa(int, char *, int); void kmain(void); @@ -32,7 +52,7 @@ int main(void) FLASH->ACR |= FLASH_ACR_LATENCY_4WS; clock_init(); - heap_init(&_ebss); + heap_init(&__bss_end__); gpio_init(); keypad_init(); serial_init(); diff --git a/src/random.c b/src/random.c index 9c1e0d1..002b862 100644 --- a/src/random.c +++ b/src/random.c @@ -1,3 +1,23 @@ +/** + * @file random.c + * Provides true random number generation functionality + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff --git a/src/script.c b/src/script.c index b69b023..be0fa37 100644 --- a/src/script.c +++ b/src/script.c @@ -1,3 +1,23 @@ +/** + * @file script.c + * Provides script library for using calculator hardware + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include @@ -24,19 +44,41 @@ int script_color(instance *it); int script_rand(instance *it); int script_getkey(instance *it); int script_pixel(instance *it); +int script_menu(instance *it); void script_loadlib(instance *it) { inew_cfunc(it, "print", script_puts); inew_cfunc(it, "gets", script_gets); - inew_cfunc(it, "delay", script_delay); - inew_cfunc(it, "rect", script_rect); + inew_cfunc(it, "getkey", script_getkey); inew_cfunc(it, "ppos", script_ppos); + + inew_cfunc(it, "pixel", script_pixel); inew_cfunc(it, "line", script_line); + inew_cfunc(it, "rect", script_rect); inew_cfunc(it, "color", script_color); + inew_cfunc(it, "rand", script_rand); - inew_cfunc(it, "getkey", script_getkey); - inew_cfunc(it, "pixel", script_pixel); + inew_cfunc(it, "delay", script_delay); + + inew_cfunc(it, "menu", script_menu); +} + +int script_menu(instance *it) +{ + char listbuf[4]; + int nargs = igetarg_integer(it, 0); + float *resps = (float *)calloc(nargs, sizeof(float)); + strncpy(listbuf, " : \0", 4); + for (int i = 0; i < nargs; i++) { + listbuf[0] = i + '0'; + dsp_puts(listbuf); + dsp_puts((char *)igetarg(it, 1 + i * 2)->value.p); + dsp_puts("\n"); + resps[i] = igetarg(it, 2 + i * 2)->value.f; + } + free(resps); + return 0; } int script_puts(instance *it) @@ -125,7 +167,7 @@ int script_rand(instance *it) { unsigned int mod = igetarg_integer(it, 0); unsigned int val = random_get(); - variable *v = make_varf(0, (float)(mod % val)); + variable *v = make_varf(0, (float)(val % mod)); ipush(it, (uint32_t)v); return 0; } diff --git a/src/serial.c b/src/serial.c index de28275..31c7744 100644 --- a/src/serial.c +++ b/src/serial.c @@ -1,3 +1,23 @@ +/** + * @file serial.c + * Provides basic serial IO (through STM debug stuff) + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff --git a/src/startup_stm32l476xx.s b/src/startup_stm32l476xx.s index f7e18a4..b26ced5 100644 --- a/src/startup_stm32l476xx.s +++ b/src/startup_stm32l476xx.s @@ -57,10 +57,8 @@ defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata -/* start address for the .bss section. defined in linker script */ -.word _sbss -/* end address for the .bss section. defined in linker script */ -.word _ebss + +.equ _estack, 0x20018000 .equ BootRAM, 0xF1E0F85F /** @@ -94,7 +92,7 @@ LoopCopyDataInit: adds r2, r0, r1 cmp r2, r3 bcc CopyDataInit - ldr r2, =_sbss + ldr r2, =__bss_start__ b LoopFillZerobss /* Zero fill the bss segment. */ FillZerobss: @@ -102,7 +100,7 @@ FillZerobss: str r3, [r2], #4 LoopFillZerobss: - ldr r3, = _ebss + ldr r3, = __bss_end__ cmp r2, r3 bcc FillZerobss diff --git a/src/stdlib.c b/src/stdlib.c index e34d2a0..f5f9cc8 100644 --- a/src/stdlib.c +++ b/src/stdlib.c @@ -1,3 +1,25 @@ +/** + * @file stdlib.c + * Provides missing C standard library functions + * The newlib versions of these calls are not being used due to dependence on + * unsupported system calls. + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include diff --git a/src/task.c b/src/task.c index 537785d..9e99ab6 100644 --- a/src/task.c +++ b/src/task.c @@ -1,3 +1,23 @@ +/** + * @file task.c + * Provides multitasking functionality + * + * Copyright (C) 2018 Clyne Sullivan + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff --git a/xinitrd/init b/xinitrd/init deleted file mode 100644 index 4fd74dd..0000000 --- a/xinitrd/init +++ /dev/null @@ -1,33 +0,0 @@ -print "Hello." - -set fg 32767 - -# draw bg, lines -rect 50 50 380 220 6375 -line 50 160 430 160 fg -line 240 50 240 270 fg - -set x 50 -do - line x 170 x 150 fg - set x (x + 20) -while (x < 431) - -set y 50 -do - line 230 y 250 y fg - set y (y + 20) -while (y < 271) - -do - rand 379 > x - rand 219 > y - rand 379 > i - rand 219 > j - set x (x + 50) - set y (y + 50) - set i (i + 50) - set j (j + 50) - - line x y i j 511 -while (1) diff --git a/xinitrd/init2 b/xinitrd/init2 deleted file mode 100644 index 47dbae1..0000000 --- a/xinitrd/init2 +++ /dev/null @@ -1,21 +0,0 @@ -do - getkey > input - print input - delay 1000 -while (1) - -#do -# getkey > input -# if (input & 4) -# rand 479 > x -# rand 319 > y -# rand 479 > i -# rand 319 > j -# rand 32767 > purple -# -# line x y i j purple -# end -#while (1) -# -#print "done" -