Put port-specific test configuration in atomport-tests.h. Rename atomuser.h to atomport.h. Non-exported port header renamed to atomport-private.h.

This commit is contained in:
Kelvin Lawson
2010-02-01 22:49:04 +00:00
parent 248e1318fb
commit f023bf26de
27 changed files with 126 additions and 101 deletions

View File

@@ -31,7 +31,7 @@
#define __ATOM_H
#include "atomtimer.h"
#include "atomuser.h"
#include "atomport.h"
/* Data types */

View File

@@ -146,7 +146,6 @@
#include <stddef.h>
#include "atom.h"
#include "atomuser.h"
/* Global data */

View File

@@ -105,7 +105,6 @@
#include "atom.h"
#include "atommutex.h"
#include "atomtimer.h"
#include "atomuser.h"
/* Local data types */

View File

@@ -97,7 +97,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtimer.h"
#include "atomuser.h"
/* Local data types */

View File

@@ -92,7 +92,6 @@
#include "atom.h"
#include "atomsem.h"
#include "atomtimer.h"
#include "atomuser.h"
/* Local data types */

View File

@@ -69,7 +69,6 @@
#include <stdio.h>
#include "atom.h"
#include "atomuser.h"
/* Data types */

View File

@@ -30,7 +30,8 @@
#ifndef __ATOM_TIMER_H
#define __ATOM_TIMER_H
#include "atomuser.h"
#include "atomport.h"
/* Callback function prototype */
typedef void ( * TIMER_CB_FUNC ) ( POINTER cb_data ) ;

View File

@@ -0,0 +1,39 @@
/*
* Copyright (c) 2010, Kelvin Lawson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. No personal names or organizations' names associated with the
* Atomthreads project may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE ATOMTHREADS PROJECT AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ATOM_PORT_PRIVATE_H
#define __ATOM_PORT_PRIVATE_H
/* CPU Frequency */
#define AVR_CPU_HZ 1000000
/* Function prototypes */
void avrInitSystemTickTimer ( void );
#endif /* __ATOM_PORT_PRIVATE_H */

View File

@@ -1,59 +1,55 @@
/*
* Copyright (c) 2010, Kelvin Lawson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. No personal names or organizations' names associated with the
* Atomthreads project may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE ATOMTHREADS PROJECT AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ATOM_USER_H
#define __ATOM_USER_H
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
/* Portable uint8_t and friends available from stdint.h on this platform */
#include <stdint.h>
/* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100
/**
* Architecture-specific types.
* Most of these are available from stdint.h on this platform, which is
* included above.
*/
#define POINTER void *
/* Critical region protection */
#define CRITICAL_STORE uint8_t sreg
#define CRITICAL_START() sreg = SREG; cli();
#define CRITICAL_END() SREG = sreg
#endif /* __ATOM_USER_H */
/*
* Copyright (c) 2010, Kelvin Lawson. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. No personal names or organizations' names associated with the
* Atomthreads project may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE ATOMTHREADS PROJECT AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __ATOM_PORT_TESTS_H
#define __ATOM_PORT_TESTS_H
/* Include Atomthreads kernel API */
#include "atom.h"
/* Prerequisite include for ATOMLOG() macro (via printf) */
#include <stdio.h>
/* Logger macro for viewing test results */
#define ATOMLOG printf_P
/*
* String location macro: for platforms which need to place strings in
* alternative locations, e.g. on avr-gcc strings can be placed in
* program space, saving SRAM. On most platforms this can expand to
* empty.
*/
#define _STR(x) PSTR(x)
/* Default thread stack size (in bytes) */
#define TEST_THREAD_STACK_SIZE 128
#endif /* __ATOM_PORT_TESTS_H */

View File

@@ -31,7 +31,7 @@
#include <avr/interrupt.h>
#include "atom.h"
#include "atomport.h"
#include "atomport-private.h"
/** Forward declarations */

View File

@@ -30,10 +30,30 @@
#ifndef __ATOM_PORT_H
#define __ATOM_PORT_H
/* CPU Frequency */
#define AVR_CPU_HZ 1000000
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
/* Portable uint8_t and friends available from stdint.h on this platform */
#include <stdint.h>
/* Required number of system ticks per second (normally 100 for 10ms tick) */
#define SYSTEM_TICKS_PER_SEC 100
/**
* Architecture-specific types.
* Most of these are available from stdint.h on this platform, which is
* included above.
*/
#define POINTER void *
/* Critical region protection */
#define CRITICAL_STORE uint8_t sreg
#define CRITICAL_START() sreg = SREG; cli();
#define CRITICAL_END() SREG = sreg
/* Function prototypes */
void avrInitSystemTickTimer ( void );
#endif /* __ATOM_PORT_H */

View File

@@ -32,7 +32,7 @@
#include <avr/pgmspace.h>
#include "atom.h"
#include "atomport.h"
#include "atomport-private.h"
#include "atomtests.h"
#include "atomtimer.h"

View File

@@ -18,7 +18,7 @@
#include "atom.h"
#include "atommutex.h"
#include "atomport.h"
#include "atomport-private.h"
#include "uart.h"
/*

View File

@@ -33,22 +33,9 @@
/* Include Atomthreads kernel API */
#include "atom.h"
/* Prerequisite include for ATOMLOG() macro (via printf) */
#include <stdio.h>
/* Include port-specific test configuration */
#include "atomport-tests.h"
/* Logger macro for viewing test results */
#define ATOMLOG printf_P
/*
* String location macro: for platforms which need to place strings in
* alternative locations, e.g. on avr-gcc strings can be placed in
* program space, saving SRAM. On most platforms this can expand to
* empty.
*/
#define _STR(x) PSTR(x)
/* Default thread stack size (in bytes) */
#define TEST_THREAD_STACK_SIZE 128
/* Default thread priority */
#define TEST_THREAD_PRIO 16

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atommutex.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test OS objects */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atommutex.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test OS objects */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atommutex.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test OS objects */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test queue size */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test queue size */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test queue size */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test queue size */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Number of queue entries */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test queue size */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test queue size */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomsem.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test OS objects */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomsem.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test OS objects */

View File

@@ -31,7 +31,6 @@
#include "atom.h"
#include "atomsem.h"
#include "atomtests.h"
#include "atomuser.h"
/* Test OS objects */