View epoll.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <sys/epoll.h> | |
int | |
main (int argc, char *argv[]) | |
{ | |
int efd[2]; | |
struct epoll_event e; |
View wdtd.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _GNU_SOURCE | |
#include <fcntl.h> | |
#include <sched.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <signal.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <sys/mman.h> | |
#include <sys/types.h> |
View ecryptfs-mount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -lt 2 ]; then | |
SRC=$1 | |
DST=$1 | |
else | |
SRC=$1 | |
DST=$2 | |
fi |
View switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -e /sys/class/gpio/gpio33 ]; then | |
echo 33 > /sys/class/gpio/export | |
sleep 0.1 | |
echo out > /sys/class/gpio/gpio33/direction | |
fi | |
if [ ! -e /sys/class/gpio/gpio35 ]; then | |
echo 35 > /sys/class/gpio/export |
View sg90.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
============================================================================ | |
Name : sg90.c | |
Author : Heiher <r@hev.cc> | |
Copyright : Copyright (c) 2020 everyone. | |
Description : SG90 Motor Controller | |
============================================================================ | |
*/ | |
#include <poll.h> |
View mg90s-bootauto.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <poll.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#include <sys/mount.h> |
View mg90s.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
============================================================================ | |
Name : mg90s.c | |
Author : Heiher <r@hev.cc> | |
Copyright : Copyright (c) 2020 everyone. | |
Description : MG90S Motor Controller | |
============================================================================ | |
*/ | |
#include <poll.h> |
View read-read-reorder.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
static volatile unsigned long s; | |
static void * | |
write_handler (void *data) | |
{ | |
for (;;) { |
View read-read-reorder.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
static volatile unsigned long s; | |
static void * | |
write_handler (void *data) | |
{ | |
for (;;) { |
View loongarch64-li-test-gen.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* li-test-gen.c | |
* wangrui <wangrui@loongson.cn> | |
* | |
* gcc -o li-test-gen li-test-gen.c | |
* ./li-test-gen | |
* gcc -o li-test li-test.c li-test.S | |
* ./li-test | |
*/ |
OlderNewer