Skip to content

Instantly share code, notes, and snippets.

@ssvb
ssvb / gist:09c55a6f07cbed8abd38
Last active August 29, 2015 14:12
fex -> board_name
'cubieboard' -> 'Cubietech_Cubieboard'
'iteaduino_plus_a10' -> 'Itead_Iteaduino_Plus'
'pcduino' -> 'LinkSprite_pcDuino'
'marsboard_a10' -> 'MarsBoard_A10'
'hackberry' -> 'Miniand_Hackberry'
'a10-olinuxino-lime' -> 'Olimex_A10-OLinuXino-Lime'
'coby_mid7042' -> 'Coby_MID7042'
'zatab' -> 'Gemei_G9'
'hyundai_a7' -> 'Hyundai_A7'
'hyundai_a7hd' -> 'Hyundai_A7HD'
@ssvb
ssvb / gist:4d4e91f30cb646ca3c4a
Created January 25, 2015 21:53
astar_mid756 u-boot lcd settings
CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:15,ri:211,up:10,lo:22,hs:30,vs:13,sync:3,vmode:0"
CONFIG_VIDEO_LCD_DCLK_PHASE=0
CONFIG_VIDEO_LCD_POWER="PH7"
CONFIG_VIDEO_LCD_BL_EN="PH6"
CONFIG_VIDEO_LCD_BL_PWM="PH0"
@ssvb
ssvb / gist:4bc7ab81130fdc88ee22
Created February 27, 2015 16:15
fel boot serial console log
U-Boot 2015.04-rc1-00877-ga7ce8e8 (Feb 27 2015 - 17:56:08) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 2 GiB
MMC: SUNXI SD/MMC: 0
Card did not respond to voltage select!
MMC init failed
Using default environment
@ssvb
ssvb / convert-16bpp-to-32bpp.c
Created March 3, 2015 23:31
Conversion from 16bpp to 32bpp
/*
* Copyright (C) 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
*
* 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:
*
diff --git a/src/gc/boehm.cr b/src/gc/boehm.cr
index bc05474..d692a28 100644
--- a/src/gc/boehm.cr
+++ b/src/gc/boehm.cr
@@ -16,6 +16,8 @@ lib LibGC
type Finalizer = Void*, Void* ->
fun register_finalizer = GC_register_finalizer(obj : Void*, fn : Finalizer, cd : Void*, ofn : Finalizer*, ocd : Void**)
fun invoke_finalizers = GC_invoke_finalizers : Int32
+ fun set_finalize_on_demand = GC_set_finalize_on_demand(value : Int32)
+ fun get_finalize_on_demand = GC_get_finalize_on_demand : Int32
can't instantiate StaticArray(T, N) with N = Int32 (N must be an integer)
*raise<String>:NoReturn +70 [0]
*Crystal::StaticArrayType#new_generic_instance<Crystal::StaticArrayType, Crystal::Program, Crystal::GenericClassType+, Hash(String, Crystal::ASTNode+)>:Crystal::StaticArrayInstanceType +434 [0]
*Crystal::GenericClassType+@Crystal::GenericType#instantiate<Crystal::GenericClassType+, Array((Crystal::Type+ | Crystal::ASTNode+))>:Crystal::GenericClassInstanceType+ +1105 [0]
*Crystal::ASTNode+@Crystal::ASTNode#accept<Crystal::ASTNode+, Crystal::Call::MatchTypeLookup>:Nil +4305 [0]
*Crystal::Call#match_block_arg<Crystal::Call, Crystal::Match>:({Array(Crystal::Var+)?, (Crystal::Type+ | Nil)} | {Nil, Nil}) +678 [0]
*Crystal::Call#instantiate<Crystal::Call, Crystal::Matches, Crystal::Program, Nil>:Array(Crystal::Def+) +902 [0]
*Crystal::Call#lookup_matches_in_type<Crystal::Call, Crystal::Program, Array(Crystal::Type+), Nil, String>:Array(Crystal::Def+) +1620 [0]
*Crystal::Call#recalculate<Crystal::Call>:Array(Crys
/*
* Copyright © 2015 Siarhei Siamashka <siarhei.siamashka@gmail.com>
* Copyright © 2015 Raspberry Pi Foundation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of the copyright holders not be used in
* advertising or publicity pertaining to distribution of the software without
https://gist.github.com/ssvb/56da061451216a37080f
# This program runs a set of tests, which are repeatedly doing
# memcpy over N bytes sized memory buffer. Each individual
# test is calibrated to run a sufficient number of iterations
# to make its duration close to 300 ms.
# For each line in the report below, tests are run 20
# times normally and 20 times slightly slower than normal
# (the difference is shown in the first column). The timings
# of these runs are also measured using gettimeofday(...)
https://gist.github.com/ssvb/56da061451216a37080f
# This program runs a set of tests, which are repeatedly doing
# memcpy over N bytes sized memory buffer. Each individual
# test is calibrated to run a sufficient number of iterations
# to make its duration close to 300 ms.
# For each line in the report below, tests are run 20
# times normally and 20 times slightly slower than normal
# (the difference is shown in the first column). The timings
# of these runs are also measured using gettimeofday(...)
https://gist.github.com/ssvb/56da061451216a37080f
# This program runs a set of tests, which are repeatedly doing
# memcpy over N bytes sized memory buffer. Each individual
# test is calibrated to run a sufficient number of iterations
# to make its duration close to 300 ms.
# For each line in the report below, tests are run 20
# times normally and 20 times slightly slower than normal
# (the difference is shown in the first column). The timings
# of these runs are also measured using gettimeofday(...)