Skip to content

Instantly share code, notes, and snippets.

View rikka0w0's full-sized avatar

Rikka0_0小六花 rikka0w0

  • UNSW
  • Sydney
View GitHub Profile
@rikka0w0
rikka0w0 / Readme.md
Created February 10, 2022 17:44
CCS11.1 on Java 17

The following steps have been tested on Kubuntu 20.04 with Oracle JDK 17. The original JRE (folder) shipped with CCS has been deleted.

Nashron JavaScript is missing since Java 15

Use standalone Nashron from OpenJDK. Create a folder named "nashorn" in the same folder with "ccstudio" and "eclipse", unzip the jars into the newly created folder. Edit "./ccs1110/ccs/eclipse/plugins/com.ti.dvt.control.engine_4.1.0.202105121547/META-INF/MANIFEST.MF", so that the final file looks like this:

Manifest-Version: 1.0
Bundle-SymbolicName: com.ti.dvt.control.engine;singleton:=true
Require-Bundle: com.ti.dvt.core,com.ti.dvt.datamodel;visibility:=reexp
 ort,org.apache.ant;visibility:=reexport,org.eclipse.ant.core;visibili
@rikka0w0
rikka0w0 / gtk.css
Last active February 16, 2022 14:55
Makes Eclipse and other GTK3 apps more compact, for small screens
@import 'colors.css';
scrollbar {
-GtkScrollbar-has-backward-stepper: false;
-GtkScrollbar-has-forward-stepper: false;
}
menubar > menuitem, .menubar > menuitem {
padding: 1px 5px;
}
@rikka0w0
rikka0w0 / dell.c
Last active March 24, 2024 16:25
Emulate Dell chargers with ESP-01 module
/*
* Example-Code that emulates a DS2502 - 1kbit EEPROM as a dell power supply
*
* Tested with
* - dell notebook https://forum.pjrc.com/threads/33640-Teensy-2-OneWire-Slave
* - DS9490R-Master, atmega328@16MHz as Slave
* - Arduino ProMini clone
* - esp8266
*
* OneWire messaging starts when AC adapter is plugged to notebook,
#!/bin/ash
# This script will draw color gradient on the framebuffer
# http://seenaburns.com/2018/04/04/writing-to-the-framebuffer/
# fbset --show
# cat /sys/class/graphics/fb0/bits_per_pixel
fbdev=/dev/fb0
width=320
height=240
@rikka0w0
rikka0w0 / buildcrossgcc.sh
Last active October 30, 2023 19:41 — forked from tautologico/buildcrossgcc.sh
Build gcc cross-compiler for armv7l (arm-linux-gnueabi)
#!/bin/sh
mkdir ~/tmp
cd ~/tmp
# See
# Typical ARM triples (see "armv7l-linux-gnueabi")
# https://bgamari.github.io/posts/2019-06-12-arm-terminology.html
# GCC -march options
# https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
@rikka0w0
rikka0w0 / Readme.md
Last active August 15, 2021 17:59
CCS10.4 on Java 16

The DVT module calls "sun.reflect.Reflection.getCallerClass".

The alternative method using StackWalker (since Java 9):

    public static Class<?> getCallerClass(int n) {
        try {
        	List<StackFrame> stack = StackWalker.getInstance(StackWalker.Option.RETAIN_CLASS_REFERENCE).walk(s -> s.limit(n).collect(Collectors.toList()));
        	StackFrame stackFrame = stack.get(stack.size()-1);
        	return stackFrame.getDeclaringClass();
        } catch (Exception e) {
@rikka0w0
rikka0w0 / Readme.md
Last active July 29, 2021 16:31
OpenSTM32 on Eclispe 2021-06 and Java 16

The problem

https://www.openstm32.org/forumthread8387#form

ENTRY org.eclipse.ui 4 0 2021-02-21 14:00:13.956
MESSAGE Unhandled event loop exception
STACK 0
java.lang.NoClassDefFoundError: org/eclipse/cdt/launch/ui/CMainTab
@rikka0w0
rikka0w0 / .config
Last active July 12, 2022 13:12
Thunder_TimeCloud_OpenWrt
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_apm821xx is not set
# CONFIG_TARGET_ath25 is not set
# CONFIG_TARGET_ath79 is not set
@rikka0w0
rikka0w0 / config.c
Last active June 11, 2021 15:57
Reliable config data storage on the built-in flash of STM32. Tolerate to power loss and flash damage.
/**
* Resource used:
* Flash, CRC
*/
/**
* A utility which reliably stores config data on the built-in flash of the MCU.
* Data integrity is guaranteed by CRC32. If a power loss happens during a flash
* write operation, upon next start-up, the last valid configuration will be used.
*/
@rikka0w0
rikka0w0 / crc.c
Created March 17, 2021 09:10
STM32F0 CRC32, supports unaligend memory as input.
/*
* Resource used:
* CRC32 peripheral
*/
#include "crc.h"
#include "stm32f0xx_ll_bus.h"
void crc32_init(void) {