Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
690b5a3
Update
noctyris May 11, 2025
c140d9d
Re-add KhiCAS
noctyris May 11, 2025
a44ad22
Update
noctyris May 11, 2025
bf9fa5b
Update CI workflow and add Golly and Fractal builds
noctyris May 13, 2025
ca14e93
Fix bug in login functionality
noctyris May 13, 2025
e06e094
Create test.yml
noctyris May 13, 2025
707e3e4
Tests
noctyris May 13, 2025
cce0187
Update test.yml
noctyris May 13, 2025
67e292a
Refactor variable names and optimize code
noctyris May 13, 2025
dcd7f51
Remove test workflow file and update
noctyris May 13, 2025
9c3c44e
Update CI workflow for KhiCAS
noctyris May 13, 2025
66b404f
Update Golly description
noctyris May 13, 2025
5511f5b
Refactor make clean command in ci-workflow.yml
noctyris May 13, 2025
0c7cb81
Update KhiCAS
noctyris May 13, 2025
4675eef
Update ci-workflow.yml
noctyris May 14, 2025
87a0d70
Init Planets app
noctyris May 14, 2025
ee037f4
Add Planets app and update Golly app description
noctyris May 14, 2025
187dc22
Add branch filters for static content deployment
noctyris May 14, 2025
235f298
Update branch name from 'main' to 'master' in static.yml
noctyris May 14, 2025
825fbba
Merge pull request #1 from noctyris/planets
noctyris May 14, 2025
a35980c
Remove unnecessary branches from workflow_dispatch
noctyris May 14, 2025
a162114
Add planets module and functionality to display and interact with pla…
noctyris May 16, 2025
06ae23e
Update speed calculation in handleRunningMode function
noctyris May 16, 2025
1cac0ee
Add isEditingWorld flag to handlePausedMode function and update main.…
noctyris May 16, 2025
4240399
Add .vscode/ to .gitignore
noctyris May 16, 2025
d0f616c
Add handleEditingWorld function for editing mode in Golly app. Refact…
noctyris May 16, 2025
e0418e6
Merge remote-tracking branch 'upstream/master'
noctyris Sep 8, 2025
083bcde
Remove Planets app
noctyris Sep 8, 2025
310389b
Remove Planets from CI
noctyris Sep 8, 2025
8c83a81
Update
noctyris Sep 8, 2025
d876808
Change displayed apps order and move # sign
noctyris Sep 8, 2025
30dc7b6
Merge branch 'master' into master
noctyris Sep 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,49 @@ on:
workflow_dispatch:

jobs:
KhiCAS:
# KhiCAS:
# runs-on: ubuntu-latest
# steps:
# - run: sudo apt-get update && sudo apt-get install wget gdb gcc g++ libgmp-dev libmpfr-dev libmpfi-dev libpari-dev libgsl0-dev libxext-dev libpng-dev libjpeg-dev libreadline-dev libncurses5-dev mesa-common-dev libx11-dev libxt-dev libxft-dev libntl-dev libgl1-mesa-dev libgl-dev libao-dev hevea debhelper libfltk1.3-dev build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi dfu-util texinfo autoconf-archive -y
#
# - uses: actions/checkout@v1
# with:
# submodules: true
# - run: make -C apps/KhiCAS clean
# - run: make KhiCAS_rebuild
# - run: ./tool/archive KhiCAS.tar KhiCAS
# - uses: actions/upload-artifact@master
# with:
# name: KhiCAS
# path: KhiCAS.tar
Golly:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update && sudo apt-get install wget gdb gcc g++ libgmp-dev libmpfr-dev libmpfi-dev libpari-dev libgsl0-dev libxext-dev libpng-dev libjpeg-dev libreadline-dev libncurses5-dev mesa-common-dev libx11-dev libxt-dev libxft-dev libntl-dev libgl1-mesa-dev libgl-dev libao-dev hevea debhelper libfltk1.3-dev build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi dfu-util texinfo autoconf-archive -y

- uses: actions/checkout@v1
with:
submodules: true
- run: make -C apps/KhiCAS cleanall
- run: make KhiCAS_rebuild
- run: ./tool/archive KhiCAS.tar KhiCAS
- run: make Golly_rebuild
- run: ./tool/archive Golly.tar Golly
- uses: actions/upload-artifact@master
with:
name: KhiCAS
path: KhiCAS.tar
name: Golly
path: Golly.tar
Fractal:
runs-on: ubuntu-latest
steps:
- run: sudo apt-get update && sudo apt-get install wget gdb gcc g++ libgmp-dev libmpfr-dev libmpfi-dev libpari-dev libgsl0-dev libxext-dev libpng-dev libjpeg-dev libreadline-dev libncurses5-dev mesa-common-dev libx11-dev libxt-dev libxft-dev libntl-dev libgl1-mesa-dev libgl-dev libao-dev hevea debhelper libfltk1.3-dev build-essential git imagemagick libx11-dev libxext-dev libfreetype6-dev libpng-dev libjpeg-dev pkg-config gcc-arm-none-eabi binutils-arm-none-eabi dfu-util texinfo autoconf-archive -y

- uses: actions/checkout@v1
with:
submodules: true
- run: make Fractal_rebuild
- run: ./tool/archive Fractal.tar Fractal
- uses: actions/upload-artifact@master
with:
name: Fractal
path: Fractal.tar
BadApple:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -163,4 +191,4 @@ jobs:
path: UnitCircle.tar

env:
ACCEPT_OFFICIAL_TOS: 1
ACCEPT_OFFICIAL_TOS: 1
15 changes: 15 additions & 0 deletions apps/Fractal/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
API=../../api
CC=arm-none-eabi-gcc
OBJCOPY=arm-none-eabi-objcopy
AR=arm-none-eabi-ar
CFLAGS=-DNDEBUG -ggdb3 -I$(API) -O3 -mcpu=cortex-m7 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -fno-common -fdata-sections -ffunction-sections -fno-exceptions -flto -fwhole-program
LDFLAGS=-Wl,-L$(API) -Wl,--gc-sections -Wl,--entry=entrypoint --specs=nosys.specs -nostartfiles -Wl,-Ur -lapi -lm

%.o: %.c
$(CC) $(CFLAGS) -c $<

app.elf: main.o peripherals.o menu.o
$(CC) $^ -o $@ $(CFLAGS) $(LDFLAGS)

clean:
rm -f *.elf *.o
Binary file added apps/Fractal/app.elf
Binary file not shown.
Binary file added apps/Fractal/app.icon
Binary file not shown.
Binary file added apps/Fractal/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions apps/Fractal/inc/menu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef MENU_H
#define MENU_H

#include "extapp_api.h"
#include "peripherals.h"

typedef struct {
char *value;
int cursor;
int max;
int x_pos;
} input_t;

void menu(int *MAX_ITER, double complex *c, int *quit);

#endif
26 changes: 26 additions & 0 deletions apps/Fractal/inc/peripherals.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef CHIPEE_PERIPHERALS_H_
#define CHIPEE_PERIPHERALS_H_

#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <complex.h>
#include <ctype.h>

#define BGCOL 0x0000

extern long long unsigned int keymappings[16];
extern int keymappings_await[16];

void clearscreen();
void waitForKeyPressed();
void waitForKeyReleased();
void waitForKeyReleasedTimeout(int timeout);
uint16_t makeColor(int iter, int max);
uint16_t rgb_16(uint16_t r, uint16_t g, uint16_t b);
char scancodeToCharFull(uint64_t scancode);
char scancodeToCharNbr(uint64_t scancode);
double complex parse_complex(const char *str);

#endif
47 changes: 47 additions & 0 deletions apps/Fractal/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <complex.h>
#include <math.h>
#include "extapp_api.h"

#include "inc/peripherals.h"
#include "inc/menu.h"

void extapp_main(void)
{
waitForKeyReleased();
int quit = 0;

int SIZE_X = 320, SIZE_Y = 240;
int MAX_ITER;
double complex c;

menu(&MAX_ITER, &c, &quit);
if (quit) return;
clearscreen();

for (int i = -(SIZE_X - SIZE_Y) / 2; i < SIZE_X - (SIZE_X - SIZE_Y) / 2; i++)
{
for (int j = 0; j < SIZE_Y; j++)
{
double x = -1.5 + (3.0 * i) / SIZE_Y;
double y = -1.5 + (3.0 * j) / SIZE_Y;
double complex z = x + y * I;
int iter = 0;
while (cabs(z) < 2 && iter < MAX_ITER)
{
z = z * z + c;
iter++;
}
uint16_t color = makeColor(iter, MAX_ITER);
extapp_pushRectUniform(i + (SIZE_X - SIZE_Y) / 2, j, 1, 1, color);
}
}

waitForKeyReleased();
waitForKeyPressed();
waitForKeyReleased();

return;
}
84 changes: 84 additions & 0 deletions apps/Fractal/menu.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#include "inc/menu.h"

#define DEFAULT rgb_16(166, 166, 166)
#define SELECTED 0xFFFF
#define NOPTIONS 2

void menu(int *MAX_ITER, double complex *c, int *quit)
{
int lselect = 0;
input_t inputs[NOPTIONS];
inputs[0] = (input_t){.cursor = 0, .max = 30, .value = calloc(31, sizeof(char)), .x_pos = 65};
inputs[1] = (input_t){.cursor = 0, .max = 3, .value = calloc(4, sizeof(char)), .x_pos = 135};
uint64_t previous_scancode = 0;

clearscreen();

extapp_pushRectUniform(0, 0, 320, 18, rgb_16(50, 50, 50));
extapp_drawTextSmall("FRACTAL", 140, 4, 0xFFFF, rgb_16(50, 50, 50), 0);

extapp_drawTextLarge(lselect == 0 ? "> c =" : " c =", 5, 40, lselect == 0 ? SELECTED : DEFAULT, BGCOL, 0);
extapp_drawTextLarge(lselect == 1 ? "> Max. iter:" : " Max. iter:", 5, 65, lselect == 1 ? SELECTED : DEFAULT, BGCOL, 0);
extapp_drawTextSmall(inputs[0].value, inputs[0].x_pos, 44, DEFAULT, BGCOL, 0);
extapp_drawTextSmall(inputs[1].value, inputs[1].x_pos, 69, SELECTED, BGCOL, 0);
extapp_drawTextLarge("<Ok>", 270, 200, DEFAULT, BGCOL, 0);
extapp_drawTextSmall("Toujours en noir et blanc", 5, 227, DEFAULT, BGCOL, 0);

while (true)
{
for (int i = 0; i < NOPTIONS; i++)
{
inputs[i].value[inputs[i].cursor] = '\0';
}

extapp_drawTextLarge(lselect == 0 ? "> c =" : " c =", 5, 40, lselect == 0 ? SELECTED : DEFAULT, BGCOL, 0);
extapp_drawTextLarge(lselect == 1 ? "> Max. iter:" : " Max. iter:", 5, 65, lselect == 1 ? SELECTED : DEFAULT, BGCOL, 0);
extapp_drawTextSmall(inputs[0].value, inputs[0].x_pos, 44, lselect == 0 ? SELECTED : DEFAULT, BGCOL, 0);
extapp_drawTextSmall(inputs[1].value, inputs[1].x_pos, 69, lselect == 1 ? SELECTED : DEFAULT, BGCOL, 0);

uint64_t scancode = extapp_scanKeyboard();

if (scancode != 0 && scancode != previous_scancode)
{
if (scancode & SCANCODE_Up) lselect = (lselect - 1 + NOPTIONS) % NOPTIONS;
else if (scancode & SCANCODE_Down) lselect = (lselect + 1) % NOPTIONS;
else if (scancode & SCANCODE_Back) {
*quit = 1;
break;
}
else if (scancode & SCANCODE_OK || scancode & SCANCODE_EXE) break;
else if (scancode & SCANCODE_Backspace && inputs[lselect].cursor > 0)
{
inputs[lselect].cursor--;
inputs[lselect].value[inputs[lselect].cursor] = '\0';
extapp_pushRectUniform(inputs[lselect].x_pos + 7 * inputs[lselect].cursor, 44 + lselect * 25, 100, 18, BGCOL);
}
else if (inputs[lselect].cursor < inputs[lselect].max)
{
char _c = lselect == 1 ? scancodeToCharNbr(scancode) : scancodeToCharFull(scancode);
if (_c != '\0')
{
inputs[lselect].value[inputs[lselect].cursor] = _c;
inputs[lselect].cursor++;
extapp_pushRectUniform(inputs[lselect].x_pos + 7 * inputs[lselect].cursor, 44 + lselect * 25, 100, 18, BGCOL);
extapp_drawTextSmall(inputs[lselect].value, inputs[lselect].x_pos, 44 + lselect * 25, SELECTED, BGCOL, 0);
}
}
}

previous_scancode = scancode;

extapp_msleep(10);
}

waitForKeyPressed();
waitForKeyReleased();

*MAX_ITER = atoi(inputs[1].value);
if (*MAX_ITER < 1)
*MAX_ITER = 100;
*c = parse_complex(inputs[0].value);

free(inputs[0].value);
free(inputs[1].value);
}
Loading