This file contains hidden or 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
//-------------------------------------------------------------------------- | |
// | |
// Copyright (C) 2011, 2012, 2013 Rhys Ulerich | |
// Copyright (C) 2012, 2013 The PECOS Development Team | |
// Please see http://pecos.ices.utexas.edu for more information on PECOS. | |
// | |
// This Source Code Form is subject to the terms of the Mozilla Public | |
// License, v. 2.0. If a copy of the MPL was not distributed with this | |
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
// |
This file contains hidden or 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
struct linear | |
{ | |
int operator()(const int value) const | |
{ | |
return value; | |
} | |
}; | |
struct logarithmic | |
{ |
This file contains hidden or 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
/* Usage: function<PA2::usart2_tx, PA3::usart2_rx>(); */ | |
enum class alternate_t | |
{ | |
AF0 = 0x0, | |
AF1 = 0x1, | |
AF2 = 0x2, | |
AF3 = 0x3, | |
AF4 = 0x4, | |
AF5 = 0x5, |
This file contains hidden or 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 <iostream> | |
#define FLOAT_VALIDATOR_ | |
template<typename T> | |
struct validator | |
{ | |
static const bool has_validator = false; | |
bool operator()(const T value) const | |
{ |
This file contains hidden or 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 <iostream> | |
#include <vector> | |
struct callback_interface | |
{ | |
virtual void callback() = 0; | |
}; | |
typedef std::pair<callback_interface *, int> callback_timeout; |
This file contains hidden or 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
import re | |
ifile = open("smybol.txt, "r") | |
data = ifile.read() | |
ifile.close() | |
map = {} | |
map["DEVICE"] = "Resistor" | |
map["VALUE"] = "10k" |
This file contains hidden or 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 | |
reg = {} | |
class metaclass_register(type): | |
def __init__(cls, name, bases, nmspc): | |
super(metaclass_register, cls).__init__(name, bases, nmspc) | |
reg[name] = cls | |
class class1(object): |
This file contains hidden or 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 <iostream> | |
using namespace std; | |
typedef void (*callback)(void); | |
struct timer1_tag {}; | |
struct timer2_tag {}; | |
static callback isr_vector[8]; |