examples/AVR/Slave/hardware.h
author gabriele at naustech dot com
Thu, 12 Jun 2014 14:07:16 +0200
changeset 791 7740ac6fdedc
parent 413 57c7a451c671
permissions -rw-r--r--
Fix : libcanfestival_unix.a not built if examples are not compiled

Problem: when building Canfestival with unix timers 'libcanfestiva_unix.a'
is built only if you build examples too.

Test case:

$ ./configure --timers=unix --can=socket --target=unix
$ make canfestival

...

no errors but 'libcanfestival_unix.a' is not built:
$ find . -name "*.a"
./src/libcanfestival.a

Changing line 90 of 'drivers/unix/Makefile.in' to:
#driver: $(OBJS)
driver: libcanfestival_$(TARGET).a

solves the problem:

$ ./configure --timers=unix --can=socket --target=unix
$ make canfestival

...

$ find . -name "*.a"
./drivers/unix/libcanfestival_unix.a
./src/libcanfestival.a
413
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     1
/*
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     2
This file is part of CanFestival, a library implementing CanOpen Stack.
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     3
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     4
Copyright (C): Edouard TISSERANT and Francis DUPIN
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     5
AVR Port: Andreas GLAUSER and Peter CHRISTEN
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     6
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     7
See COPYING file for copyrights details.
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     8
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
     9
This library is free software; you can redistribute it and/or
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    10
modify it under the terms of the GNU Lesser General Public
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    11
License as published by the Free Software Foundation; either
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    12
version 2.1 of the License, or (at your option) any later version.
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    13
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    14
This library is distributed in the hope that it will be useful,
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    15
but WITHOUT ANY WARRANTY; without even the implied warranty of
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    17
Lesser General Public License for more details.
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    18
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    19
You should have received a copy of the GNU Lesser General Public
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    20
License along with this library; if not, write to the Free Software
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    21
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    22
*/
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    23
/******************************************************************************
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    24
MCU ports and Bits
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    25
Makros for access on hardware
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    26
******************************************************************************/
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    27
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    28
#ifndef _HARDWARE_INCLUDED
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    29
#define _HARDWARE_INCLUDED
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    30
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    31
/******************************************************************************
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    32
Makros for bit access on the ports and registers
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    33
******************************************************************************/
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    34
// Macros for set and clear bits in I/O registers
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    35
#define setbit(address,bit) ((address) |= (1<<(bit)))
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    36
#define clearbit(address,bit) ((address) &= ~(1<<(bit)))
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    37
#define togglebit(address,bit) ((address) ^= (1<<(bit)))
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    38
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    39
// Macro for testing of a single bit in an I/O location
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    40
#define checkbit(address,bit) ((address) & (1<<(bit)))
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    41
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    42
/************************** Hardware Makros **********************************/
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    43
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    44
// Read the inputs
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    45
#define get_inputs()		(~PINA)
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    46
#define read_bcd()		(~PINC & 0x0F)
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    47
// Write the outputs
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    48
#define set_outputs(val)	PORTB = ~(val)
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    49
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    50
#endif	// _HARDWARE_INCLUDED
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    51
57c7a451c671 New named folder, first DS401 profile module, Makefile
peter
parents:
diff changeset
    52