changeset 210:0e1a8cacc09d main

Just sync various projects that are not in current use.
author Bob Cook <bob@bobcookdev.com>
date Thu, 17 Apr 2014 21:56:02 -0700
parents 07ffde905dcc
children ddd95e6ede8a
files main/robots/odr-display-4d/bcui.inc main/robots/odr-display-4d/odr-display-4d.4dg main/robots/odr-display-bridge/jamfile main/robots/odr-display-bridge/main.cpp main/robots/odr-display-bridge/project_defs.h
diffstat 5 files changed, 412 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/main/robots/odr-display-4d/bcui.inc	Thu Apr 17 21:54:03 2014 -0700
+++ b/main/robots/odr-display-4d/bcui.inc	Thu Apr 17 21:56:02 2014 -0700
@@ -60,8 +60,6 @@
 #constant BCUI_WIDGET_ARROW_OFFSET_1 :=  8
 #constant BCUI_WIDGET_ARROW_OFFSET_2 := 10
 
-#constant BCUI_WIDGET_TEXT_HEIGHT := 26
-
 // ----------------------------------------------------------------------------------------
 
 var bcui_view_list; // linked list of view info structures
@@ -69,9 +67,25 @@
 
 // ----------------------------------------------------------------------------------------
 
+// these are the built-in monospaced fonts, and are much faster to render
+#constant BCUI_MONO_FONT_LG := FONT3
+#constant BCUI_MONO_FONT_SM := FONT1
+
+// these are custom fonts, loaded from external storage
+var BCUI_TITLE_FONT_LG;
+var BCUI_TITLE_FONT_SM;
+
+// ----------------------------------------------------------------------------------------
+
 func bcui_init()
+
     bcui_view_list    := 0;
     bcui_current_view := 0;
+
+    if ( file_Mount() != 0 )
+        BCUI_TITLE_FONT_LG := file_LoadImageControl( "tahoma15.da1", "tahoma15.gc1", 1 );
+    endif
+
 endfunc
 
 // ----------------------------------------------------------------------------------------
@@ -235,7 +249,7 @@
     bcui_current_view := view;
 
     if ( bcui_current_view == 0 )
-        gfx_RectangleFilled( 0, 0, gfx_Get( X_MAX ), gfx_Get( Y_MAX ), BLACK );
+        gfx_RectangleFilled( 0, 0, gfx_Get( X_MAX ), gfx_Get( Y_MAX ), GREEN );
         return;
     endif
 
@@ -327,7 +341,7 @@
                          color );
 
     // paint the label
-    txt_Set( FONT_ID, hFont1 );
+    txt_Set( FONT_ID, BCUI_TITLE_FONT_LG );
     txt_Set( TEXT_COLOUR, WHITE );
     txt_Set( TEXT_HIGHLIGHT, color );
     var private w, h;
--- a/main/robots/odr-display-4d/odr-display-4d.4dg	Thu Apr 17 21:54:03 2014 -0700
+++ b/main/robots/odr-display-4d/odr-display-4d.4dg	Thu Apr 17 21:56:02 2014 -0700
@@ -50,6 +50,8 @@
     // did the receive buffer overflow? reset if so
     if ( com_Full() && com_Count() == 0 )
         com_Reset();
+        com_Init( comm_rx_buffer, COMM_RX_BUFFER_SIZE * 2 /* 2x for words to bytes */, 0 /* no qualifier */ );
+        setbaud( BAUD_115200 );
         comm_state := COMM_STATE_GET_MARKER;
         comm_errors++;
     endif
@@ -96,7 +98,7 @@
 
 endfunc
 
-#constant ORDR_FONT  := FONT1
+#constant ODRD_FONT  := FONT1
 #constant ODRD_BKGND := 0x4208
 
 func odrd_get_cmd_msg_size( var command )
@@ -122,11 +124,11 @@
     switch ( command )
 
         case 'F': // motor speed set, front
-            bcui_text_center( message, 185, 150, ORDR_FONT, WHITE, ODRD_BKGND );
+            bcui_text_center( message, 185, 150, ODRD_FONT, WHITE, ODRD_BKGND );
             break;
 
         case 'f': // motor speed actual, front
-            bcui_text_left( message, 275, 200, ORDR_FONT, WHITE, ODRD_BKGND );
+            bcui_text_left( message, 275, 200, ODRD_FONT, WHITE, ODRD_BKGND );
             break;
 
     endswitch
@@ -156,47 +158,147 @@
 
     theView := bcui_create_view( ODRD_BKGND );
 
-    btn_Hello := bcui_create_button( theView, 50, 100, "Hello", BLUEVIOLET );
-    btn_There := bcui_create_button( theView, 50, 150, "There", CORNFLOWERBLUE );
+    //btn_Hello := bcui_create_button( theView, 50, 100, "Hello", BLUEVIOLET );
+    //btn_There := bcui_create_button( theView, 50, 150, "There", CORNFLOWERBLUE );
     bcui_create_button( theView, 50, 200, "One", BLUE );
 
-    bcui_create_arrow( theView, 150, 150, BCUI_WIDGET_ARROW_LEFT, GREEN );
-    bcui_create_arrow( theView, 220, 150, BCUI_WIDGET_ARROW_RIGHT, GREEN );
-    bcui_create_arrow( theView, 185, 115, BCUI_WIDGET_ARROW_UP, GREEN );
-    bcui_create_arrow( theView, 185, 185, BCUI_WIDGET_ARROW_DOWN, GREEN );
+    //bcui_create_arrow( theView, 150, 150, BCUI_WIDGET_ARROW_LEFT, GREEN );
+    //bcui_create_arrow( theView, 220, 150, BCUI_WIDGET_ARROW_RIGHT, GREEN );
+    //bcui_create_arrow( theView, 185, 115, BCUI_WIDGET_ARROW_UP, GREEN );
+    //bcui_create_arrow( theView, 185, 185, BCUI_WIDGET_ARROW_DOWN, GREEN );
 
     bcui_activate_view( theView );
 
-    bcui_text_right( "Actual:", 270, 200, ORDR_FONT, WHITE, ODRD_BKGND );
-    bcui_text_left( "000", 275, 200, ORDR_FONT, WHITE, ODRD_BKGND );
+    //bcui_text_right( "Actual:", 270, 200, ODRD_FONT, WHITE, ODRD_BKGND );
+    //bcui_text_left( "000", 275, 200, ODRD_FONT, WHITE, ODRD_BKGND );
 
-    bcui_text_center( "---", 185, 150, ORDR_FONT, WHITE, ODRD_BKGND );
+    //bcui_text_center( "---", 185, 150, ODRD_FONT, WHITE, ODRD_BKGND );
 
-    gfx_RectangleFilled( 50, 50, 100, 70, GREEN );
-    gfx_RectangleFilled( 120, 50, 140, 70, RED );
+    //gfx_RectangleFilled( 50, 50, 100, 70, GREEN );
+    //gfx_RectangleFilled( 120, 50, 140, 70, RED );
 
     comm_init( odrd_get_cmd_msg_size, odrd_do_command );
 
+    // FONT1: 14 rows, 40 columns, leaves room top/bottom for buttons
+    var private text_indent, text_height;
+    var private i;
+    /*
+    text_indent := strwidth( "0123456789012345678901234567890123456789" );
+    text_height := strheight();
+    text_indent := ( ( gfx_Get( X_MAX ) - text_indent ) / 2 );
+    text_height := text_height + 2; //* 3 / 2;
+    gfx_MoveTo( text_indent, 20 );
+    putstr( "abcdefghijklmnopqrstuvwzyzABCDEFGHIJKLMN" );
+//    putstr( "01234567890123456789012345678901234567890" );
+    gfx_MoveTo( text_indent, 20 + text_height );
+    putstr( "abcdefghijklmnopqrstuvwzyzABCDEFGHIJKLMN" );
+    gfx_MoveTo( 10, 45 );
+    putnum( DEC, text_height );
+    for ( i := 0; i < 14; i++ )
+        gfx_MoveTo( 250, 20 + ( i * text_height ) );
+        putnum( DEC, i );
+    next
+    */
+
+    // FONT3: 12 rows, 35 columns, leaves room top/bottom for buttons
+    //txt_Set( FONT_ID, FONT3 );
+    //text_indent := strwidth( "01234567890123456789012345678901234" );
+    //text_height := strheight();
+    //text_indent := ( ( gfx_Get( X_MAX ) - text_indent ) / 2 );
+    //text_height := text_height + 2;
+    /*
+    gfx_MoveTo( text_indent, 20 );
+    putstr( "01234567890123456789012345678901234" );
+    gfx_MoveTo( text_indent, 20 + text_height );
+    putstr( "abcdefghijklmnopqrstuvwzyzABCDEFGHI" );
+    gfx_MoveTo( 10, 60 );
+    putnum( DEC, text_height );
+    for ( i := 0; i < 12; i++ )
+        if ( i > 1 )
+            gfx_MoveTo( 250, 20 + ( i * text_height ) );
+            putnum( DEC, i );
+        endif
+    next
+    */
+
+    // box some rows of text
+    //txt_Set( FONT_ID, FONT1 );
+    //text_indent := strwidth( "01234567890123456789012345678901234" );
+    //text_height := strheight();
+    //text_indent := ( ( gfx_Get( X_MAX ) - text_indent ) / 2 );
+    //text_height := text_height + 2;
+    //gfx_MoveTo( 150, 20 );
+    //var private box_width;
+    //box_width := 20 + 3 * charwidth( '0' );
+    //gfx_BoxTo( 150 + box_width, 20 + 10 + 3 * ( 4 + text_height ) );
+    //gfx_MoveTo( 150 + 5, 20 + 1 * ( 0 + text_height ) );
+    //putstr( "000" );
+    //gfx_MoveTo( 150 + 5, 20 + 2 * ( 0 + text_height ) );
+    //putstr( "111" );
+    //bcui_text_center( "XyZ", 150 + ( box_width / 2 ), 20 + 5 + 1 * ( 4 + text_height ) - ( text_height / 2 ) - 2, FONT3, WHITE, ODRD_BKGND );
+    //bcui_text_center( "123", 150 + ( box_width / 2 ), 20 + 5 + 2 * ( 4 + text_height ) - ( text_height / 2 ) - 2, FONT3, WHITE, ODRD_BKGND );
+    //bcui_text_center( "ABC", 150 + ( box_width / 2 ), 20 + 5 + 3 * ( 4 + text_height ) - ( text_height / 2 ) - 2, FONT3, WHITE, ODRD_BKGND );
+
+    //bcui_text_right( "Front Speed:", 200, 20 + 1 * ( 2 + text_height ) - ( text_height / 2 ) - 1, FONT1, WHITE, ODRD_BKGND );
+    //bcui_text_right( "Rear Speed:",  200, 20 + 2 * ( 2 + text_height ) - ( text_height / 2 ) - 1, FONT1, WHITE, ODRD_BKGND );
+
+    //bcui_text_left( "000", 210, 20 + 1 * ( 2 + text_height ) - ( text_height / 2 ) - 1, FONT1, WHITE, ODRD_BKGND );
+    //bcui_text_left( "+12", 210, 20 + 2 * ( 2 + text_height ) - ( text_height / 2 ) - 1, FONT1, WHITE, ODRD_BKGND );
+
+    bcui_text_right( "Speed", 65, 50, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_center( "Front", 100, 30, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_center( "000", 100, 50, BCUI_MONO_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_center( "000", 100, 62, BCUI_MONO_FONT_SM, GRAY, ODRD_BKGND );
+    bcui_text_center( "Rear", 150, 30, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_center( "000", 150, 50, BCUI_MONO_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_center( "000", 150, 62, BCUI_MONO_FONT_SM, GRAY, ODRD_BKGND );
+
+    bcui_text_right( "Steer", 65, 85, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+//    bcui_text_center( "000", 100, 85, BCUI_MONO_FONT_LG, WHITE, ODRD_BKGND );
+//    bcui_text_center( "000", 150, 85, BCUI_MONO_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_center( "???", 100, 85, BCUI_MONO_FONT_LG, RED, ODRD_BKGND );
+    bcui_text_center( "???", 150, 85, BCUI_MONO_FONT_LG, RED, ODRD_BKGND );
+
+    gfx_Set( OBJECT_COLOUR, BLUE );
+    gfx_MoveTo( 75, 20 );
+    gfx_LineTo( 75, 95 );
+    gfx_MoveTo( 125, 20 );
+    gfx_LineTo( 125, 95 );
+    gfx_MoveTo( 175, 20 );
+    gfx_LineTo( 175, 95 );
+
+    bcui_text_right( "Location", 65, 120, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_left( "N 123 45.678  W 123 45.678", 85, 120, BCUI_MONO_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_right( "Satellites", 65, 135, BCUI_TITLE_FONT_LG, GRAY, ODRD_BKGND );
+    bcui_text_left( "02", 85, 135, BCUI_MONO_FONT_SM, GRAY, ODRD_BKGND );
+
+    bcui_text_right( "Waypoint", 65, 160, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_left( "N 123 45.678  W 123 45.678", 85, 160, BCUI_MONO_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_right( "Distance", 65, 175, BCUI_TITLE_FONT_LG, WHITE, ODRD_BKGND );
+    bcui_text_left( "25", 85, 175, BCUI_MONO_FONT_LG, GRAY, ODRD_BKGND );
+
     var private x, y;
     repeat
 
         comm_read();
 
-        txt_Set( FONT_ID, ORDR_FONT );
-        gfx_MoveTo( 5, 10 );
+        txt_Set( TEXT_COLOUR, WHITE );
+        txt_Set( TEXT_HIGHLIGHT, ODRD_BKGND );
+        txt_Set( FONT_ID, ODRD_FONT );
+        gfx_MoveTo( 5, gfx_Get( Y_MAX ) - 10 );
         putnum( DEC, mem_Heap() );
-        gfx_MoveTo( 70, 10 );
+        gfx_MoveTo( 70, gfx_Get( Y_MAX ) - 10 );
         putnum( DEC, comm_errors );
 
         if ( touch_Get( TOUCH_STATUS ) == TOUCH_PRESSED )
             x := touch_Get( TOUCH_GETX );
             y := touch_Get( TOUCH_GETY );
             if ( x >= 50 && x <= 100 && y >= 50 && y <= 70 )
-                gfx_RectangleFilled( 120, 50, 140, 70, WHITE );
-                while ( touch_Get( TOUCH_STATUS ) != TOUCH_RELEASED )
-                    pause( 50 );
-                wend
-                gfx_RectangleFilled( 120, 50, 140, 70, RED );
+//                gfx_RectangleFilled( 120, 50, 140, 70, WHITE );
+//                while ( touch_Get( TOUCH_STATUS ) != TOUCH_RELEASED )
+//                    pause( 50 );
+//                wend
+//                gfx_RectangleFilled( 120, 50, 140, 70, RED );
             else
                 var private btn;
                 btn := bcui_do_touch();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main/robots/odr-display-bridge/jamfile	Thu Apr 17 21:56:02 2014 -0700
@@ -0,0 +1,48 @@
+# -----------------------------------------------------------------------------------------
+#
+#   Copyright (C) 2014 Bob Cook
+#
+#   Bob Cook Development, Robotics Library
+#   http://www.bobcookdev.com/rl/
+#    
+#   Permission is hereby granted, free of charge, to any person obtaining a copy
+#   of this software and associated documentation files (the "Software"), to deal
+#   in the Software without restriction, including without limitation the rights
+#   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+#   copies of the Software, and to permit persons to whom the Software is
+#   furnished to do so, subject to the following conditions:
+#
+#   The above copyright notice and this permission notice shall be included in
+#   all copies or substantial portions of the Software.
+#
+#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+#   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+#   THE SOFTWARE.
+#
+# -----------------------------------------------------------------------------------------
+
+if $(TRACE) { echo "trace /robots/odr-display-bridge/jamfile" ; }
+
+SubDir TOP robots odr-display-bridge ;
+
+# -----------------------------------------------------------------------------------------
+
+avr_executable
+    odr-display-bridge atmega16m1
+    : main.cpp
+      canmsgs.cpp
+      comm.cpp
+      display.cpp
+      packages.avr.can.pkg
+      packages.avr.device.pkg
+      packages.avr.redir.pkg
+      packages.common.can.pkg
+      packages.common.util.pkg
+    ;
+
+# -----------------------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main/robots/odr-display-bridge/main.cpp	Thu Apr 17 21:56:02 2014 -0700
@@ -0,0 +1,165 @@
+// ----------------------------------------------------------------------------------------
+//
+//  Copyright (C) 2014 Bob Cook
+//    
+//  Bob Cook Development, Robotics Library
+//  http://www.bobcookdev.com/rl/
+// 
+//  Bridge between the CAN messaging network and the 4D Systems touch LCD display.
+//
+//  Permission is hereby granted, free of charge, to any person obtaining a copy
+//  of this software and associated documentation files (the "Software"), to deal
+//  in the Software without restriction, including without limitation the rights
+//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//  copies of the Software, and to permit persons to whom the Software is
+//  furnished to do so, subject to the following conditions:
+// 
+//  The above copyright notice and this permission notice shall be included in
+//  all copies or substantial portions of the Software.
+// 
+//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//  THE SOFTWARE.
+//
+// ----------------------------------------------------------------------------------------
+
+#include <avr/interrupt.h>
+#include <avr/io.h>
+#include <avr/pgmspace.h>
+#include <avr/sleep.h>
+
+#include <ctype.h>
+#include <stdio.h>
+
+#include "project_defs.h"
+
+#include "func.h"
+
+#include "packages/avr/device/int_helpers.h"
+#include "packages/avr/device/spinwait.h"
+#include "packages/avr/device/uart.h"
+
+#include "packages/avr/redir/redir.h"
+
+#include "packages/common/util/misc.h"
+
+// always after other includes
+#include "packages/avr/device/workaround34734.h"
+
+// ----------------------------------------------------------------------------------------
+
+static inline void led_red_off() __attribute__((always_inline));
+static inline void led_red_off()
+{
+    PORTB &= ~( 1 << PB2 );
+}
+
+static inline void led_red_on() __attribute__((always_inline));
+static inline void led_red_on()
+{
+    PORTB |= ( 1 << PB2 );
+}
+
+static inline void led_red_toggle() __attribute__((always_inline));
+static inline void led_red_toggle()
+{
+    PORTB ^= ( 1 << PB2 );
+}
+
+static inline void led_green_off() __attribute__((always_inline));
+static inline void led_green_off()
+{
+    PORTC &= ~( 1 << PC4 );
+}
+
+static inline void led_green_on() __attribute__((always_inline));
+static inline void led_green_on()
+{
+    PORTC |= ( 1 << PC4 );
+}
+
+static inline void led_green_toggle() __attribute__((always_inline));
+static inline void led_green_toggle()
+{
+    PORTC ^= ( 1 << PC4 );
+}
+
+// ----------------------------------------------------------------------------------------
+
+void hw_init()
+{
+    //--    Turn off all interrupts.
+
+    cli();
+    interrupts_clear_all();
+
+    //--    Indicator LEDs on PORTB.2 and PORTC.4
+
+    DDRB |= ( 1 << PB2 );
+    led_red_off();
+
+    DDRC |= ( 1 << PC4 );
+    led_green_off();
+
+    //--    Blink the LED just to say hello.
+    
+    for ( uint8_t i = 0; i < 5; i++ )
+    {
+        led_red_on();
+        led_green_off();
+        spinwait_delay_ms( 75 );
+        led_red_off();
+        led_green_on();
+        spinwait_delay_ms( 75 );
+    }
+
+    led_red_off();
+    led_green_off();
+    
+    //--    Initialize the serial output.
+
+    comm_init();
+    //redir_initialize();
+
+    //--    Re-enable interrupts.
+
+    sei();
+}
+
+// ----------------------------------------------------------------------------------------
+
+int main()
+{
+    //--    Initialize the hardware.
+
+    hw_init();
+
+//    int i = 0;
+
+    for ( ;; )
+    {
+//        spinwait_delay_ms( 100 );
+//        printf_P( PSTR("Hello world!\n") );
+//        spinwait_delay_ms( 100 );
+//        led_green_toggle();
+//        spinwait_delay_ms( 100 );
+//        printf_P( PSTR("loop iteration %d\n"), i++ );
+//        led_green_toggle();
+
+        //--    Any pending CAN messages to receive/process?
+
+        if ( ! canmsg_process_pending() )
+        {
+            // ++can_comm_errors;
+        }
+    }
+
+    return 0;
+}
+
+// ----------------------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main/robots/odr-display-bridge/project_defs.h	Thu Apr 17 21:56:02 2014 -0700
@@ -0,0 +1,57 @@
+// ----------------------------------------------------------------------------------------
+//
+//  Copyright (C) 2014 Bob Cook
+//
+//  Permission is hereby granted, free of charge, to any person obtaining a copy
+//  of this software and associated documentation files (the "Software"), to deal
+//  in the Software without restriction, including without limitation the rights
+//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+//  copies of the Software, and to permit persons to whom the Software is
+//  furnished to do so, subject to the following conditions:
+//  
+//  The above copyright notice and this permission notice shall be included in
+//  all copies or substantial portions of the Software.
+//  
+//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+//  THE SOFTWARE.
+//
+// ----------------------------------------------------------------------------------------
+
+#if !defined( PROJECT_DEFS_H )
+#define PROJECT_DEFS_H
+
+// ----------------------------------------------------------------------------------------
+//  packages/avr/common
+
+#define PRJ_CPU_FREQ    16000000L
+
+// ----------------------------------------------------------------------------------------
+//  packages/avr/can
+
+#define PRJ_M1CAN_ENABLE
+#define PRJ_M1CAN_CANBUS_250_KHZ
+#define PRJ_M1CAN_TX_BUFFER_SIZE  8
+
+// ----------------------------------------------------------------------------------------
+//  packages/avr/device
+
+#define PRJ_UART0_USE_POLLED_MODE
+//#define PRJ_UART0_USE_INTERRUPT_MODE
+#define PRJ_UART0_EXTENDED_READ_WRITE
+
+// ----------------------------------------------------------------------------------------
+//  packages/avr/redir
+
+#define PRJ_REDIR_VIA_UART0
+#define PRJ_REDIR_UART_BAUDRATE         19200
+#define PRJ_REDIR_OUTPUT_DO_AUTO_CRLF
+
+
+#endif // #if !defined( PROJECT_DEFS_H )
+// ----------------------------------------------------------------------------------------
+