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
for(int inf = 0; inf < pConfig->bNumInterfaces; inf++) { | |
const libusb_interface& inter = pConfig->interface[inf]; | |
for(int alt = 0; alt < inter.num_altsetting; alt++) { | |
const libusb_interface_descriptor& idesc = inter.altsetting[alt]; | |
for(int desc = 0; desc < idesc.bNumEndpoints; desc++) { | |
const libusb_endpoint_descriptor& EndPnt = idesc.endpoint[desc]; | |
assert(EndPnt.bDescriptorType == LIBUSB_DT_ENDPOINT); | |
if(EndPnt.bEndpointAddress & LIBUSB_ENDPOINT_IN) { | |
m_EndPntIn = EndPnt.bEndpointAddress; | |
} |
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 <string.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#define M_HOSTNAME_NTP "ntp.nict.jp" | |
#define M_LOCAL_PORT (123) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:id="@+id/activity_main" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:paddingBottom="@dimen/activity_vertical_margin" | |
android:paddingLeft="@dimen/activity_horizontal_margin" |
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 | |
boot=new | |
app=1 | |
spi_speed=40 | |
spi_mode=QIO | |
spi_size_map=6 | |
echo "gen_misc.sh version 20150911" |
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
// | |
// $ git clone https://github.com/jedisct1/libsodium | |
// $ cd libsodium | |
// $ mkdir mylib | |
// $ ./autogen.sh | |
// $ ./configure --prefix=`pwd`/mylib --disable-shared | |
// $ make | |
// $ make install | |
// $ cd mylib | |
// $ gcc -Iinclude -o tst test_chacha20.c -Llib -lsodium |
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 <string.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <sys/ipc.h> | |
#include <sys/msg.h> | |
#include <unistd.h> |
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
/* mtest.c - memory-mapped database tester/toy */ | |
/* | |
* Copyright 2011-2017 Howard Chu, Symas Corp. | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted only as authorized by the OpenLDAP | |
* Public License. | |
* | |
* A copy of this license is available in the file LICENSE in the |
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> | |
#include <unistd.h> | |
#include "lmdb.h" | |
static void *thread_func(void *pArg) | |
{ | |
int code = (int)pArg; //warningが出るが、気にしない |
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
// キャラクタデバイスのGPIOデバイスドライバ(cdev) | |
#define SUCCESS 0 | |
#define NODE_NAME "Ext_GPIO" | |
#define MY_BUFF_SIZE 4096 | |
#define MAP_SIZE (0x10000) | |
#define MAP_BASE_ADDR (0x41200000) | |
#define BTN_PIO_BASE (0x00000) | |
#define LED_PIO_BASE (0x10000) |
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 <time.h> | |
int main(void) | |
{ | |
struct timespec ts; | |
int ret = clock_gettime(CLOCK_REALTIME, &ts); | |
if (ret == 0) { | |
printf("tv_sec=%lu, tv_nsec=%ld\n", (unsigned long)ts.tv_sec, ts.tv_nsec); | |
} else { |
OlderNewer