Skip to content

Instantly share code, notes, and snippets.

View pandax381's full-sized avatar

YAMAMOTO Masaya pandax381

View GitHub Profile
@pandax381
pandax381 / arduino-esp32-mruby.md
Last active June 25, 2018 01:33
arduino-esp32 に mruby を組み込む手順

mruby本体の準備

$ export ARDUINO_ESP32_ROOT=$HOME/Documents/Arduino/hardware/espressif/esp32
$ cd $ARDUINO_ESP32_ROOT
$ mkdir mruby
$ cd mruby
$ git clone https://github.com/mruby/mruby.git
$ cd mruby 
$ git checkout 1.4.1
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
gshadow: files
@pandax381
pandax381 / softfloat_test2.c
Created August 17, 2017 04:02
Berkeley SoftFloat test 2
#include <stdio.h>
#include "softfloat.h"
int
main (void) {
float32_t a = {0x3F800000};
float32_t b = {0x40000000};
float32_t c = f32_add(a, b);
fprintf(stderr, "0x%x (%ld) + 0x%x (%ld) = 0x%x (%ld)\n",
@pandax381
pandax381 / softfloat_test.c
Last active August 17, 2017 02:58
Berkeley SoftFloat test
#include <stdio.h>
#include "softfloat.h"
int
main (void) {
float32_t a = ui32_to_f32(0x3F800000); /* 1.0 */
float32_t b = ui32_to_f32(0x40000000); /* 2.0 */
float32_t c = f32_add(a, b);
fprintf(stderr, "0x%lx + 0x%lx = 0x%lx\n",
@pandax381
pandax381 / float_test.c
Created August 17, 2017 02:48
simple float test
#include <stdio.h>
#include <stdint.h>
int
main (void) {
float a = 1.0;
float b = 2.0;
float c = a + b;
fprintf(stderr, "sizeof(float): %d\n", sizeof(float));
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
@pandax381
pandax381 / boot.log
Created December 6, 2016 09:03
orangepi one boot log with self build u-boot and busybox
U-Boot SPL 2016.11 (Dec 06 2016 - 07:54:39)
DRAM: 512 MiB
Trying to boot from MMC1
U-Boot 2016.11 (Dec 06 2016 - 07:54:39 +0000) Allwinner Technology
CPU: Allwinner H3 (SUN8I 1680)
Model: Xunlong Orange Pi One
DRAM: 512 MiB
@pandax381
pandax381 / main.go
Last active November 16, 2016 08:03
libnss-dummy-go
package main
/*
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <limits.h>
#include <nss.h>
#include <sys/types.h>
#include <netdb.h>
#include <errno.h>
#include <string.h>
#include <assert.h>
#include <unistd.h>
#include <net/if.h>
#include <stdlib.h>
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>