Skip to content

Instantly share code, notes, and snippets.

View stolk's full-sized avatar

Bram Stolk stolk

  • Game Studio Abraham Stolk Inc.
  • Vancouver
View GitHub Profile
@stolk
stolk / bluepaint.c
Created June 21, 2023 04:18
Blue Paint
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <assert.h>
int blw;
int blh;
uint8_t* blu;
int imw;
#define HT16K33_CMD_BLINK 0x80
#define HT16K33_CMD_BRIGHTNESS 0xE0
enum blink_values
{
HT16K33_BLINK_NONE=0,
HT16K33_BLINK_500MS,
HT16K33_BLINK_1000MS,
HT16K33_BLINK_2000MS
};
dynamic memory init success,heap size = 26 Kbyte
C906 start...
mtimer clk:1000000
linux load start...
len:0x003942fc
vm linux load done!
dtb load done!
opensbi load done!
load time: 462996 us
[13:14:32.178] - EFUSE_CFG
[13:14:32.180] - BOOTHEADER_GROUP0_CFG
[13:14:32.181] - BOOTHEADER_GROUP1_CFG
[13:14:32.201] - Create bootheader using /home/stolk/devcube/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini
[13:14:32.202] - Updating data according to </home/stolk/devcube/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini[BOOTHEADER_GROUP0_CFG]>
[13:14:32.210] - Created file len:352
[13:14:32.215] - Create bootheader using /home/stolk/devcube/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini
[13:14:32.216] - Updating data according to </home/stolk/devcube/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini[BOOTHEADER_GROUP1_CFG]>
[13:14:32.222] - Created file len:352
[13:14:32.224] - Create efuse using /home/stolk/devcube/chips/bl808/img_create_mcu/efuse_bootheader_cfg.ini
# -*- coding:utf-8 -*-
# Copyright (C) 2021- BOUFFALO LAB (NANJING) CO., LTD.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
stolk@workpc:~/src/bl808_linux$ bflb-mcu-tool --chipname=bl808 --port=/dev/ttyACM2 --baudrate=2000000 --firmware=out/low_load_bl808_m0.bin
[16:03:52.056] -
[16:03:52.056] - ==================================================
[16:03:52.056] - Chip name is bl808
[16:03:52.056] - Serial port is /dev/ttyACM2
[16:03:52.056] - Baudrate is 2000000
[16:03:52.056] - Firmware is out/low_load_bl808_m0.bin
[16:03:52.056] - Device Tree is None
[16:03:52.056] - ==================================================
[16:03:52.056] - Default xtal is 40M
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <stdlib.h>
@stolk
stolk / ppmtorgba.c
Created May 19, 2022 19:12
Converts 24 bit PPM file into a 32 bit raw data blob that can be pasted to /dev/fb0 as is.
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <inttypes.h>
int main(int argc, char* argv[])
{
FILE* f = stdin;
if (argc!=1 && argc!=2)
@stolk
stolk / set_ticker_portfolio.py
Created April 12, 2022 17:18
TurboLEDz Stock Ticker Customization Script.
#!/usr/bin/python3
#
# set_ticker_portfolio.py
#
# (c)2022 Game Studio Abraham Stolk Inc.
#
# This utility sets the ticker symbols that the TurboLEDz stock ticker will retrieve.
# Default set that the device ships with is comprised of the corporations in the DOW30 index:
#
# Only works with:
static float halton23[ 6000 ][ 2 ] = {
-1.000000,-1.000000,
0.000000,-0.333333,
-0.500000,0.333333,
0.500000,-0.777778,
-0.750000,-0.111111,
0.250000,0.555556,
-0.250000,-0.555556,
0.750000,0.111111,
-0.875000,0.777778,