Skip to content

Instantly share code, notes, and snippets.

@benpicco
benpicco / main.c
Created October 28, 2013 04:09
Calculation gets interrupted, one timer is lost
#include <stdio.h>
#include "vtimer.h"
#include "thread.h"
#include "msg.h"
char timer_stack[KERNEL_CONF_STACKSIZE_DEFAULT];
struct timer_msg {
vtimer_t timer;
@benpicco
benpicco / main.c
Created October 28, 2013 16:38
second message is lost
#include <stdio.h>
#include "vtimer.h"
#include "thread.h"
#include "msg.h"
char timer_stack[KERNEL_CONF_STACKSIZE_DEFAULT];
struct timer_msg {
char* msg;
diff --cc native/drivers/native-uart0.c
index 7e8489b,38720fd..0000000
--- a/native/drivers/native-uart0.c
+++ b/native/drivers/native-uart0.c
@@@ -8,15 -8,6 +8,18 @@@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
++<<<<<<< HEAD
+#include <sys/types.h>
Program received signal SIGSEGV, Segmentation fault.
0x0804a727 in native_isr_entry (sig=29, info=0x808f44c <sigalt_stk+7212>,
context=0x808f4cc <sigalt_stk+7340>) at irq_cpu.c:319
319 _native_cur_ctx = (ucontext_t *)active_thread->sp;
(gdb) bt
#0 0x0804a727 in native_isr_entry (sig=29, info=0x808f44c <sigalt_stk+7212>,
context=0x808f4cc <sigalt_stk+7340>) at irq_cpu.c:319
#1 <signal handler called>
#2 0xf7fdb430 in __kernel_vsyscall ()
#3 0xf7ecc933 in write () from /lib/i386-linux-gnu/libc.so.6
2013-12-23 16:59:37,956 - INFO # pid | name | state Q | pri | stack ( used) location | runtime | switches
2013-12-23 16:59:37,964 - INFO # 0 | idle | pending Q | 31 | 160 ( 148) 0x4000000c | nan% | 4294967295
2013-12-23 16:59:37,976 - INFO # 1 | main | running Q | 15 | 4608 ( 2284) 0x400000ac | nan% | 4294967295
2013-12-23 16:59:37,981 - INFO # 2 | uart0 | bl rx _ | 14 | 324 ( 236) 0x40001398 | nan% | 4294967295
2013-12-23 16:59:37,991 - INFO # 3 | udp_packet_handler | bl rx _ | 15 | 4608 ( 208) 0x40008de0 | nan% | 4294967295
2013-12-23 16:59:38,000 - INFO # 4 | tcp_packet_handler | bl rx _ | 15 | 512 ( 200) 0x40008bdc | nan% | 4294967295
2013-12-23 16:59:38,013 - INFO # 5 | tcp_general_timer | sleeping _ | 16 | 512 ( 216) 0x40009ff0 | nan% | 4294967295
2013-12-23 16:59:38,018 - INFO # 6 | radio | bl rx _ | 13 | 4608 ( 212) 0x40006d5c |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import cmd, serial, sys, socket, threading, readline, time, os
if __name__ == "__main__":
ser = serial.Serial(port="/dev/ttyUSB0", baudrate=115200, dsrdtr=0, rtscts=0)
ser.setDTR(0)
ser.setRTS(0)
#include <stdio.h>
#include <destiny.h>
#define IF_ID (0)
#define NODE_ID (23)
static void init(void) {
ipv6_addr_t tmp;
net_if_set_hardware_address(IF_ID, NODE_ID);
####
#### Sample Makefile for building apps with the RIOT OS
####
#### The Sample Filesystem Layout is:
#### /this makefile
#### ../../RIOT
#### ../../boards for board definitions (if you have one or more)
####
# name of your application
int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed) {
uint32_t _speed;
switch (speed) {
case SPI_SPEED_100KHZ:
_speed = 100000;
break;
case SPI_SPEED_400KHZ:
_speed = 400000;
break;
#include "printf.h"
#include "flash.h"
#include "spiffs.h"
#define LOG_PAGE_SIZE 128 // can't read more than this in one go
static u8_t spiffs_work_buf[LOG_PAGE_SIZE*2];
static u8_t spiffs_fds[32*4];
static u8_t spiffs_cache_buf[(LOG_PAGE_SIZE+32)*4];
static spiffs fs;