Skip to content

Instantly share code, notes, and snippets.

View xueliu's full-sized avatar
🏠
Working from home

Xue Liu xueliu

🏠
Working from home
View GitHub Profile
cmake_minimum_required(VERSION 3.1)
include(CMakeParseArguments)
macro(open_eebus_project)
#message(DEBUG "---- processing open_eebus_project")
set(options DEBUG)
set(oneValueArgs
#include <iostream>
#include <string>
#include <array>
#include <functional>
using namespace std;
class NodeManager {
private:
#include <cstdint>
// normal device class e.g., i2c, spi
class Device {
public:
Device() {}
bool write8(uint8_t page, uint8_t addr, uint8_t v)
{
return true;
}
1. digital last
1.1 switch-off/max-off/min-off
{signal:
[
{name: 'Switch Off Req', wave: '010.....'},
{name: 'ELA', wave: '01....0.'},
{name: 'Active', wave: '1.0....1'},
{name: 'Max Off Timer', wave: '0.1...0.'},
{name: 'Min Off Timer', wave: '0.1.0...'},
{name: 'Switch On Block', wave: '0.1.0...'},
#include <iostream>
#include <memory>
#include <mutex>
#include <unordered_map>
using namespace std;
class Stock
{
public:
#!/bin/bash
g++ -std=c++14 main.cpp publisher.cpp -o app -lavahi-core -lavahi-common -lavahi-client
#include <iostream>
#include <thread>
#include <mutex>
class Comm
{
private:
Comm() {}
#!/bin/sh
qemu-system-arm \
-M vexpress-a9 -smp 1 \
-m 256 \
-kernel output/images/zImage \
-dtb output/images/vexpress-v2p-ca9.dtb \
-drive file=output/images/rootfs.ext2,if=sd,format=raw \
-append "console=ttyAMA0,115200 root=/dev/mmcblk0" \
-net nic,model=lan9118 \
#!/bin/bash
echo "21" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio21/direction
echo "1" > /sys/class/gpio/gpio21/value
sleep 5
echo "0" > /sys/class/gpio/gpio21/value
sleep 1
echo "0" > /sys/class/gpio/gpio21/value
Sat Jan 31 06:22:30 1970 kern.notice kernel: [ 0.000000] Linux version 4.4.14 (build@7e42c4b42298) (gcc version 5.3.0 (OpenWrt GCC 5.3.0 v1.1.0) ) #3 SMP Tue Feb 14 20:33:07 UTC 2017
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] SoC Type: IMG Pistachio SoC (B0)
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] bootconsole [early0] enabled
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] CPU0 revision is: 0001a120 (MIPS interAptiv (multi))
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] FPU revision is: 0173a000
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] MIPS: machine is IMG marduk - Creator Ci40 with ca8210
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] Determined physical RAM map:
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] memory: 10000000 @ 00000000 (usable)
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] Initrd not found or empty - disabling initrd
Sat Jan 31 06:22:30 1970 kern.info kernel: [ 0.000000] Zone ran