Skip to content

Commit

Permalink
Adding documentation formatting and updating the structure of some of…
Browse files Browse the repository at this point in the history
… the files.
  • Loading branch information
ashgti committed Oct 23, 2011
1 parent 6e70fc9 commit f36dc74
Show file tree
Hide file tree
Showing 33 changed files with 1,930 additions and 1,676 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -12,3 +12,6 @@ dist
*.pyo
*.swp
*_ui.py
docs/doxygen/*
serial.default.output.txt
docs/doxygen.cfg
4 changes: 2 additions & 2 deletions CMakeLists.txt
@@ -1,9 +1,9 @@
cmake_minimum_required (VERSION 2.6)
project (VEE)

include_directories ("${PROJECT_SOURCE_DIR}/include")
include_directories ("${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/include")

add_definitions(-g -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long)
add_definitions(-O3 -g -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long)

if(APPLE)
set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
Expand Down
2 changes: 2 additions & 0 deletions Makefile
@@ -1,5 +1,7 @@
VEE_TARGET=student.cc
PYSIDE_UIC=/usr/local/bin/pyside-uic
CC=clang
CXX=clang++

DOXYGEN = doxygen

Expand Down
6 changes: 3 additions & 3 deletions docs/Doxyfile.cfg.in
Expand Up @@ -532,7 +532,7 @@ SHOW_DIRECTORIES = NO
# This will remove the Files entry from the Quick Index and from the
# Folder Tree View (if specified). The default is YES.

SHOW_FILES = YES
SHOW_FILES = NO

# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
# Namespaces page.
Expand Down Expand Up @@ -764,7 +764,7 @@ SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.

INLINE_SOURCES = YES
INLINE_SOURCES = NO

# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
# doxygen to hide any special comment blocks from generated source code
Expand Down Expand Up @@ -804,7 +804,7 @@ USE_HTAGS = NO
# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.

VERBATIM_HEADERS = YES
VERBATIM_HEADERS = NO

#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
Expand Down
51 changes: 27 additions & 24 deletions include/arduino.h
Expand Up @@ -22,20 +22,20 @@
$Id: wiring.h 804 2009-12-18 16:05:52Z dmellis $
*/

#ifndef ARDUINO_API_H
#define ARDUINO_API_H
#ifndef INCLUDE_ARDUINO_H_
#define INCLUDE_ARDUINO_H_

#include <string>
#include <fstream>
#include <stdint.h>
#include <stdlib.h>
// #include <avr/io.h>
// #include <avr/config.h>
#include <avr/config.h>

#include <string>

#include "binary.h"
#include "ardulator.h"

#ifdef __cplusplus
extern "C"{
extern "C" {
#endif

#define HIGH 0x1
Expand Down Expand Up @@ -76,29 +76,31 @@ extern "C"{
#undef abs
#endif

#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define min(a, b) ((a) < (b)?(a):(b))
#define max(a, b) ((a) > (b)?(a):(b))
#define abs(x) ((x) > 0?(x):-(x))
#define constrain(amt, low, high) ((amt) < (low)?(low):((amt) > (high)? \
(high):(amt)))
#define round(x) ((x) >= 0 ? (long)((x) + 0.5):(long)((x) - 0.5))
#define radians(deg) ((deg)*DEG_TO_RAD)
#define degrees(rad) ((rad)*RAD_TO_DEG)
#define sq(x) ((x)*(x))

#define interrupts() sei()
#define noInterrupts() cli()

#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
#define clockCyclesPerMicrosecond() (F_CPU / 1000000L)
#define clockCyclesToMicroseconds(a) ((a) / clockCyclesPerMicrosecond())
#define microsecondsToClockCycles(a) ((a) * clockCyclesPerMicrosecond())

#define lowByte(w) ((uint8_t) ((w) & 0xff))
#define highByte(w) ((uint8_t) ((w) >> 8))

#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) \
: bitClear(value, bit))

typedef unsigned int word;

Expand Down Expand Up @@ -141,7 +143,7 @@ void processSignal(const char* signal_id);
void registerPin(const char* signal_id, uint8_t pin_id);

#ifdef __cplusplus
} // extern "C"
} // extern "C"
#endif

#ifdef __cplusplus
Expand All @@ -167,7 +169,7 @@ extern void initalize_simulator();
extern void reset_simulator();
extern bool register_signal(SignalImp* head);
#ifdef __cplusplus
} // end extern "C"
} // end extern "C"
#endif

#define DEC 10
Expand All @@ -176,10 +178,11 @@ extern bool register_signal(SignalImp* head);
#define BIN 2
#define BYTE 0

class Print {
virtual class Print {
private:
void printNumber(unsigned long, uint8_t);
void printFloat(double, uint8_t);

public:
virtual void write(uint8_t) = 0;
virtual void write(const char *str);
Expand Down Expand Up @@ -221,7 +224,7 @@ class HardwareSerial : public Print {
uint8_t _rb_head;
uint8_t _rb_tail;

std::fstream _ofile;
FILE* _ofile;
public:
HardwareSerial(int rxPin, int txPin);
~HardwareSerial();
Expand All @@ -231,12 +234,12 @@ class HardwareSerial : public Print {
int read(void);
void flush(void);
virtual void write(uint8_t);
uint8_t pin();
using Print::write; // pull in write(str) and write(buf, size) from Print
uint8_t pin() const;
using Print::write; // pull in write(str) and write(buf, size) from Print
};

void registerSerial(const char* signal_id, HardwareSerial &serial);
void registerSerial(const char* signal_id, const HardwareSerial &serial);

extern HardwareSerial Serial;

#endif /* ARDUINO_API_H */
#endif // INCLUDE_ARDUINO_H_

0 comments on commit f36dc74

Please sign in to comment.