Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wovo committed Feb 10, 2019
1 parent a8db26e commit af88944
Show file tree
Hide file tree
Showing 903 changed files with 68,255 additions and 1,574 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ __codelite.workspace
*.lst
*.exe
*.pdf
*.html
_dummy.jpg
bmptk_*_stack.c
_push.bat
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions attic/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This attic contains stuff that I might (re)use in the future,
but is not currently part of the hwlib library.
File renamed without changes.
12 changes: 6 additions & 6 deletions src/hwlib.hpp → attic/src/hwlib.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
//
// ============================================================================

#ifndef _HWLIB_INCLUDED
#define _HWLIB_INCLUDED
#ifndef HWLIB_INCLUDED
#define HWLIB_INCLUDED

#define HWLIB_QUOTE( FILE ) #FILE
#define HWLIB_INCLUDE( FILE ) HWLIB_QUOTE( ../library/FILE )

#if defined(ARDUINO_ARCH_AVR)
#define _HWLIB_TARGET_OK
#define HWLIB_TARGET_OK
#undef putc
#undef abs
#include HWLIB_INCLUDE( hwlib-arduino-uno.hpp )
#endif

#if defined(ARDUINO_ARCH_SAM)
#define _HWLIB_TARGET_OK
#define HWLIB_TARGET_OK
#include HWLIB_INCLUDE( hwlib-arduino-due.hpp )
#endif

#ifndef _HWLIB_TARGET_OK
#ifndef HWLIB_TARGET_OK
#error no valid ARDUINO_* target for HwLib
#endif

#endif // #ifndef _HWLIB_INCLUDED
#endif // #ifndef HWLIB_INCLUDED
2 changes: 2 additions & 0 deletions attic/src/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
No, this is not the library source:
this directory exists only to make HwLib usable as an Arduino library.
2 changes: 1 addition & 1 deletion library/stm32x.hpp → attic/stm32x.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ static void SetSysClock(void)

// Wait till PLL is used as system clock source
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08){}
}
}
42 changes: 42 additions & 0 deletions demo/ardsuino-nano/hc595-kitt/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// ==========================================================================
//
// blink the LED on an Arduino Uno
//
// (c) Wouter van Ooijen ([email protected]) 2017
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// ==========================================================================

#include "hwlib.hpp"

int main( void ){

auto ds = hwlib::target::pin_out( hwlib::target::pins::a2 );
auto oe = hwlib::target::pin_out( hwlib::target::pins::a3 );
auto stcp = hwlib::target::pin_out( hwlib::target::pins::a4 );
auto shcp = hwlib::target::pin_out( hwlib::target::pins::a5 );

oe.set( 0 );
auto spi = hwlib::spi_bus_bit_banged_sclk_mosi_miso(
shcp,
ds,
hwlib::pin_in_dummy
);
auto hc595 = hwlib::hc595( spi, stcp );

auto leds = hwlib::port_out_from_pins(
hc595.p1,
hc595.p2,
hc595.p3,
hc595.p4,
hc595.p5,
hc595.p6,
hc595.p7
);

hwlib::kitt( leds );
}

27 changes: 27 additions & 0 deletions demo/ardsuino-nano/hc595-kitt/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#============================================================================
#
# simple project makefile (just a main file)
#
# (c) Wouter van Ooijen ([email protected]) 2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
#============================================================================

# source files in this project (main.* is automatically assumed)
SOURCES :=

# header files in this project
HEADERS :=

# other places to look for files for this project
SEARCH :=

RESULTS += main.lss

# set RELATIVE to the next higher directory
# and defer to the appropriate Makefile.* there
RELATIVE := ..
include $(RELATIVE)/makefile.link
60 changes: 60 additions & 0 deletions demo/ardsuino-nano/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#############################################################################
#
# Makefile that defers to subdirectories
#
# (c) Wouter van Ooijen (www.voti.nl) 2016
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
#############################################################################

SUBDIRS += empty
SUBDIRS += blink
SUBDIRS += hello
SUBDIRS += hd44780-shield

BUILDDIRS = $(SUBDIRS:%=build-%)
CLEANDIRS = $(SUBDIRS:%=clean-%)
NOTABDIRS = $(SUBDIRS:%=notab-%)

ifeq ($(OS),Windows_NT)
REMOVE := $(BMPTK)/tools/bmptk-rm
MAKE := bmptk-make
else
REMOVE := rm -rf
MAKE := make
endif

.phony: clean build run error notab (BUILDDIRS) $(CLEANDIRS) $(NOTABDIRS)

# include the bmptk makefile, and clean this directory

clean: $(CLEANDIRS)
$(MAKE) -f makefile.link clean

# defer to the subdirectories

$(CLEANDIRS):
$(MAKE) -C $(@:clean-%=%) clean

build: $(BUILDDIRS)
$(BUILDDIRS):
$(MAKE) -C $(@:build-%=%) build

notab: $(NOTABDIRS)
$(NOTABDIRS):
$(MAKE) -C $(@:notab-%=%) notab

# user error handling

run: error

MSG = You are trying to run in a library directory.
MSG += Make one of the project source files your current editor file.

error:
$(error $(MSG) )


27 changes: 27 additions & 0 deletions demo/ardsuino-nano/makefile.link
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#############################################################################
#
# makefile.link
#
# common settings and uplink for ARduino Due projects
#
# (c) Wouter van Ooijen ([email protected]) 2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
#############################################################################

# common settings for Arduino Uno projects
TARGET ?= arduino_uno
SERIAL_PORT ?= COM4
CONSOLE_BAUDRATE ?= 2400

ifneq ($(OS),Windows_NT)
SERIAL_BAUDRATE ?= ttyUSB0
endif

# defer to the next-level makefile
RELATIVE ?= .
RELATIVE := $(RELATIVE)/..
include $(RELATIVE)/makefile.link
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==========================================================================
//
// blink the LED on an Arduino Due
// blink the LED on an Arduino Uno
//
// (c) Wouter van Ooijen ([email protected]) 2017
//
Expand All @@ -10,15 +10,9 @@
//
// ==========================================================================

//! [[blink example]]
#include "hwlib-arduino-due.hpp"
#include "hwlib.hpp"

int main( void ){

// kill the watchdog (ATSAM3X8E specific)
WDT->WDT_MR = WDT_MR_WDDIS;

auto led = hwlib::target::pin_out( 1, 27 );
auto led = hwlib::target::pin_out( 1, 5 );
hwlib::blink( led );
}
//! [[blink example]]
27 changes: 27 additions & 0 deletions demo/ardsuino-nano/mcp23017-kitt/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#============================================================================
#
# simple project makefile (just a main file)
#
# (c) Wouter van Ooijen ([email protected]) 2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
#============================================================================

# source files in this project (main.* is automatically assumed)
SOURCES :=

# header files in this project
HEADERS :=

# other places to look for files for this project
SEARCH :=

RESULTS += main.lss

# set RELATIVE to the next higher directory
# and defer to the appropriate Makefile.* there
RELATIVE := ..
include $(RELATIVE)/makefile.link
24 changes: 24 additions & 0 deletions demo/ardsuino-nano/nano-kitt/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// ==========================================================================
//
// blink the LED on an Arduino Uno
//
// (c) Wouter van Ooijen ([email protected]) 2017
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// ==========================================================================

#include "hwlib.hpp"

int main( void ){
auto led0 = hwlib::target::pin_out( hwlib::target::pins::a0 );
auto led1 = hwlib::target::pin_out( hwlib::target::pins::a1 );
auto led2 = hwlib::target::pin_out( hwlib::target::pins::a2 );
auto led3 = hwlib::target::pin_out( hwlib::target::pins::a3 );
auto led4 = hwlib::target::pin_out( hwlib::target::pins::a4 );
auto led5 = hwlib::target::pin_out( hwlib::target::pins::a5 );
auto leds = hwlib::port_out_from_pins( led0, led1, led2, led3, led4, led5 );
hwlib::kitt( leds );
}
27 changes: 27 additions & 0 deletions demo/ardsuino-nano/nano-kitt/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#============================================================================
#
# simple project makefile (just a main file)
#
# (c) Wouter van Ooijen ([email protected]) 2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
#============================================================================

# source files in this project (main.* is automatically assumed)
SOURCES :=

# header files in this project
HEADERS :=

# other places to look for files for this project
SEARCH :=

RESULTS += main.lss

# set RELATIVE to the next higher directory
# and defer to the appropriate Makefile.* there
RELATIVE := ..
include $(RELATIVE)/makefile.link
14 changes: 14 additions & 0 deletions demo/ardsuino-nano/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
These directories contain the demo applications for one target.

The Makefile can clean or build the applications.

The Makefile.link is included by the makefiles in the subdirectories;
it sets the target-specific things and defers to the
Makefile.link in the parent directory.

(c) Wouter van Ooijen ([email protected]) 2017

Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)

2 changes: 2 additions & 0 deletions demo/ardsuino-nano/update_codelite_workspace.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bmptk-make -f Makefile.link codelite_workspace
pause
10 changes: 5 additions & 5 deletions demo/arduino-due/chris/_codelite.project
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<File Name="main.cpp"/>
<File Name="due-spi.hpp"/>
<File Name="glcd-oled-spi.hpp"/>
<File Name="makefile"/>
<File Name="Makefile"/>
</VirtualDirectory>
<Settings Type="Dynamic Library">
<GlobalSettings>
Expand All @@ -44,8 +44,8 @@
</Linker>
<ResourceCompiler Options=""/>
</GlobalSettings>
<Configuration Name="Debug" CompilerType="gnu g++" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<Compiler Options="-g;-O0;-std=c++11" C_Options="-g;-O0;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
<Configuration Name="Debug" CompilerType="MinGW ( TDM-GCC-32 )" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<Compiler Options="-g;-O0;-std=c++11" C_Options="-g;-O0;-Wall" Assembler="" Required="no" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
<IncludePath Value=".;../Catch/include"/>
</Compiler>
<Linker Options="" Required="yes"/>
Expand Down Expand Up @@ -82,8 +82,8 @@
<SearchPaths/>
</Completion>
</Configuration>
<Configuration Name="Release" CompilerType="clang++" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<Compiler Options="" C_Options="" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
<Configuration Name="Release" CompilerType="MinGW ( TDM-GCC-32 )" DebuggerType="GNU gdb debugger" Type="Dynamic Library" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append">
<Compiler Options="" C_Options="" Assembler="" Required="no" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0">
<IncludePath Value="."/>
</Compiler>
<Linker Options="-O2" Required="yes"/>
Expand Down
14 changes: 11 additions & 3 deletions demo/arduino-uno/.codelite/__codelite.session
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<Session Name="C:\Program Files (x86)\Arduino\libraries\hwlib\demo\arduino-uno\__codelite.workspace">
<Session Name="C:\ti-software\hwlib\demo\arduino-uno\__codelite.workspace">
<int Value="0" Name="m_selectedTab"/>
<wxString Value="C:\Program Files (x86)\Arduino\libraries\hwlib\demo\arduino-uno\__codelite.workspace" Name="m_workspaceName"/>
<TabInfoArray Name="TabInfoArray"/>
<wxString Value="C:\ti-software\hwlib\demo\arduino-uno\__codelite.workspace" Name="m_workspaceName"/>
<TabInfoArray Name="TabInfoArray">
<TabInfo>
<wxString Value="C:\ti-software\hwlib\library\hwlib-arduino-uno.hpp" Name="FileName"/>
<int Value="434" Name="FirstVisibleLine"/>
<int Value="323" Name="CurrentLine"/>
<wxArrayString Name="Bookmarks"/>
<IntVector Name="CollapsedFolds"/>
</TabInfo>
</TabInfoArray>
<SerializedObject Name="m_breakpoints">
<long Value="0" Name="Count"/>
</SerializedObject>
Expand Down
Binary file modified demo/arduino-uno/.codelite/__codelite.tags
Binary file not shown.
Binary file modified demo/arduino-uno/.codelite/refactoring.db
Binary file not shown.
Loading

0 comments on commit af88944

Please sign in to comment.