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
use std::collections::BTreeMap; | |
use super::models::SensorTypeEnum; | |
use super::MeteoError; | |
mod enviro_phat; | |
mod serial_node; | |
pub trait SensorNode { | |
fn measure(&self, measurement_type: SensorTypeEnum, sensor_id: u32) -> Result<f32, MeteoError>; |
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
#[macro_export] | |
macro_rules! derive_message_wrapper { | |
($type_name:tt<$($lifetime:tt),+>, $msg_id:pat => $parse_func:expr, $alloc_func:expr, $free_func:expr) => ( | |
derive_message_wrapper!($type_name<$($lifetime),+>, [$msg_id => $parse_func], $alloc_func, $free_func); | |
); | |
($type_name:tt<$($lifetime:tt),+>, [$($msg_id:pat => $parse_func:expr),+], $alloc_func:expr, $free_func:expr) => ( | |
impl<$($lifetime),+> $crate::bindings::message_dispatcher::TryFrom<*mut $crate::bindings::message_dispatcher::message> for $type_name { | |
derive_message_wrapper!(@try_from_impl_payload $type_name<$($lifetime),+>, [$($msg_id => $parse_func),+]); | |
} |
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
#![no_std] | |
#![feature(lang_items)] | |
mod messages; | |
#[lang = "panic_fmt"] | |
extern "C" fn panic_fmt() -> ! { | |
loop { | |
} | |
} |
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
SDCC = sdcc | |
STM8FLASH = stm8flash | |
CHIP = STM8S003 | |
CHIP_LCASE = $(shell echo $(CHIP) | tr '[:upper:]' '[:lower:]') | |
CFLAGS = -lstm8 -mstm8 -L./libsrc/build/ -lstm8s_periph.lib -I./libsrc/inc -D$(CHIP) -DUSE_STDPERIPH_DRIVER | |
MAIN_SOURCE = launcher |
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
# $Id$ | |
# Maintainer: Anatol Pomozov <[email protected]> | |
# Modified by: Ondrej Palenicek <[email protected]> | |
_target=arm-none-eabi | |
pkgname=$_target-newlib | |
_pkgver=3.1.0 | |
pkgver="$_pkgver"_nostubs | |
pkgrel=2 | |
_upstream_ver=$_pkgver |
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
#!/usr/bin/python | |
import sys | |
import re | |
subtract = float(sys.argv[1]) / 1000 | |
mode = 'IN' | |
with open(sys.argv[2], "r") as f: |
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
inline void push_prg_stack(void) __attribute__((always_inline)) | |
{ | |
register int *new_psp asm("r0"); | |
asm("msr psp, r0\n\t" | |
"sub r0, #32\n\t" | |
"mov r1, r0\n\t" | |
"stm r1!, {r4-r7}\n\t" | |
"mov r4, r8\n\t" | |
"mov r5, r9\n\t" |