Startpunkten
This commit is contained in:
53
hal.h
Normal file
53
hal.h
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#ifndef _HAL_H_
|
||||||
|
#define _HAL_H_
|
||||||
|
/*
|
||||||
|
** File: hal.h
|
||||||
|
**
|
||||||
|
** Contents: Rubus OS
|
||||||
|
** Validation Application
|
||||||
|
** Target 8086
|
||||||
|
** Borland 3.1 C/C++ Programming Environment
|
||||||
|
** HAL Definitions
|
||||||
|
**
|
||||||
|
** Version: 1.1
|
||||||
|
**
|
||||||
|
** Copyright 1996-98 Arcticus Systems AB
|
||||||
|
** All Rights Reserved
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
|
||||||
|
#define SIZE_MONITOR_BUFFER 120
|
||||||
|
|
||||||
|
|
||||||
|
/*==============================================
|
||||||
|
Types
|
||||||
|
===============================================*/
|
||||||
|
#define LOC_FUNC
|
||||||
|
#define LOC_VAR
|
||||||
|
#define LOC_VAR_ASC
|
||||||
|
|
||||||
|
/*===============================================
|
||||||
|
Externals
|
||||||
|
===============================================*/
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void redLogShow(void);
|
||||||
|
extern void blueLogShow(void);
|
||||||
|
|
||||||
|
/*===============================================
|
||||||
|
Prototypes
|
||||||
|
===============================================*/
|
||||||
|
extern void halExit(void);
|
||||||
|
extern void halBsTimerStart(void);
|
||||||
|
extern void halBsTimerStop(void);
|
||||||
|
extern void halWrite(UCHARP buffer);
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
64
hal_sim.c
Normal file
64
hal_sim.c
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
** File: hal_8086.c
|
||||||
|
**
|
||||||
|
** Contents: Rubus OS
|
||||||
|
** Tutorial
|
||||||
|
** Target Configuration 8086 DOS
|
||||||
|
**
|
||||||
|
** Version: 1.0
|
||||||
|
**
|
||||||
|
** Copyright 1996-97 Arcticus Systems AB
|
||||||
|
** All Rights Reserved
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
#include <basic/bs_log.h>
|
||||||
|
#include <red/r_thread.h>
|
||||||
|
|
||||||
|
/*===============================================
|
||||||
|
Externals
|
||||||
|
================================================*/
|
||||||
|
extern halBsInit();
|
||||||
|
|
||||||
|
/*=========================================================
|
||||||
|
halInit
|
||||||
|
|
||||||
|
=========================================================*/
|
||||||
|
INT halInit(void)
|
||||||
|
{
|
||||||
|
halBsInit();
|
||||||
|
return(RCODE_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=========================================================
|
||||||
|
halWrite
|
||||||
|
|
||||||
|
=========================================================*/
|
||||||
|
void halWrite(UCHARP buffer)
|
||||||
|
|
||||||
|
{
|
||||||
|
printf(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*=========================================================
|
||||||
|
halHalt
|
||||||
|
|
||||||
|
=========================================================*/
|
||||||
|
void halHalt()
|
||||||
|
{
|
||||||
|
halBsTimerDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*=========================================================
|
||||||
|
halExit
|
||||||
|
|
||||||
|
=========================================================*/
|
||||||
|
void halExit()
|
||||||
|
{
|
||||||
|
halBsExit();
|
||||||
|
}
|
||||||
|
|
||||||
270
main.c
Normal file
270
main.c
Normal file
@@ -0,0 +1,270 @@
|
|||||||
|
//#
|
||||||
|
//# main.c
|
||||||
|
//#
|
||||||
|
//# =======================================================
|
||||||
|
//# Lab i realtidssystem
|
||||||
|
//# Styrning av tåg
|
||||||
|
//#
|
||||||
|
//#
|
||||||
|
//# Christian Ohlsson, Daniel Alfredsson
|
||||||
|
//# Karlstads universitet
|
||||||
|
//# 991008
|
||||||
|
//# =======================================================
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <personal/mon.h>
|
||||||
|
#include <red/r_thread.h>
|
||||||
|
#include <blue/b_thread.h>
|
||||||
|
#include "taglab_r.h"
|
||||||
|
#include "train.h"
|
||||||
|
#include "hal.h"
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# SPEED
|
||||||
|
//# Här anger vi standard hastighet på tågen.
|
||||||
|
#define SPEED 12
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# bsPosixTime_t
|
||||||
|
//# Anger Rubustid.
|
||||||
|
static bsPosixTime_t const timeSec = {90L, 0L};
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# blueSleep()
|
||||||
|
//# Berättar för kompilatorn att denna
|
||||||
|
//# externa funktion används.
|
||||||
|
extern void blueSleep();
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# Train_t
|
||||||
|
//# Skapar våra två tåg. Dessa är globala.
|
||||||
|
Train_t Train0;
|
||||||
|
Train_t Train8;
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# sleep()
|
||||||
|
//# Låter Rubus sova i ett antal millisekunder.
|
||||||
|
void sleep(unsigned int millisecs) {
|
||||||
|
TYPE_TIME tp;
|
||||||
|
bsPosixTime_t t;
|
||||||
|
t.tvSec = 0;
|
||||||
|
t.tvNsec = millisecs * 1000000L;
|
||||||
|
tp = bsTvToJiffies((bsPosixTime_t*)&t);
|
||||||
|
blueSleep(&tp);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# blueError()
|
||||||
|
//# Anropas om fel i blå kärnan inträffar.
|
||||||
|
INT blueError(INT code, blueThreadId_t thread) {
|
||||||
|
INT error = code;
|
||||||
|
blueThreadId_t id = thread;
|
||||||
|
halWrite("Det blev blått fel...");
|
||||||
|
halHalt();
|
||||||
|
return(RCODE_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# redError()
|
||||||
|
//# Anropas om fel i röda kärnan inträffar.
|
||||||
|
INT redError(INT code, VOIDP thread) {
|
||||||
|
halWrite("Det blev rött fel...");
|
||||||
|
sleep(300);
|
||||||
|
halExit();
|
||||||
|
return(RCODE_OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# train_init()
|
||||||
|
//# Initierar tågbibliotek, skapar tåg,
|
||||||
|
//# ställer växlar och kör igång tågen.
|
||||||
|
bool_t train_init() {
|
||||||
|
if(trainlib_init() != True) {
|
||||||
|
halWrite("Failed to initialized library.\n");
|
||||||
|
return False;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
halWrite("Library initialized.\n"); sleep(200);
|
||||||
|
trainlib_start(); sleep(100);
|
||||||
|
Train0 = train_create(60); sleep(100);
|
||||||
|
Train8 = train_create(78); sleep(100);
|
||||||
|
switch_open(1); sleep(100);
|
||||||
|
switch_open(4); sleep(100);
|
||||||
|
switch_close(2); sleep(100);
|
||||||
|
switch_close(3); sleep(100);
|
||||||
|
train_set_speed(Train8, SPEED); sleep(100);
|
||||||
|
train_set_speed(Train0, SPEED); sleep(100);
|
||||||
|
return True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# blueIdleMain()
|
||||||
|
//# Körs om ingen annan process körs.
|
||||||
|
void blueIdleMain(void) {
|
||||||
|
halWrite("\nblueIdleMain()");
|
||||||
|
while(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# blueFunk()
|
||||||
|
//# Styr hela förloppet, dvs ställer om
|
||||||
|
//# växlar och startar och stoppar tåg.
|
||||||
|
void blueFunk() {
|
||||||
|
int go=0;
|
||||||
|
uint mod1, mod2;
|
||||||
|
if(!train_init()) halHalt();
|
||||||
|
while(1) {
|
||||||
|
// sleep(5);
|
||||||
|
mod1 = sensor_read(1);
|
||||||
|
// sleep(10);
|
||||||
|
mod2 = sensor_read(2);
|
||||||
|
// if(mod1 != 0) printf("\nmod1: %d",mod1);
|
||||||
|
// if(mod2 != 0) printf("\nmod2: %d", mod2);
|
||||||
|
|
||||||
|
// Begin switch (Behövs detta?)
|
||||||
|
if(mod2&0x0080 || mod2&0x8000) {
|
||||||
|
switch_open(2); // 0:an kan köra
|
||||||
|
sleep(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mod2&0x0040 || mod2&0x4000) {
|
||||||
|
switch_close(2); // 8:an kan köra
|
||||||
|
sleep(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hastighetsändringar för tåget
|
||||||
|
if (mod1 & 0x0020 || mod2 & 0x0001) { //8 kommer till krysset
|
||||||
|
train_set_speed(Train8, 0);
|
||||||
|
sleep(100);
|
||||||
|
switch_open(2); //från vänster
|
||||||
|
go=1;
|
||||||
|
sleep(100);
|
||||||
|
}
|
||||||
|
if (mod2 & 0x8000 || mod1 & 0x0010) { //8 kommer till krysset
|
||||||
|
train_set_speed(Train8, 0);
|
||||||
|
sleep(100);
|
||||||
|
switch_open(2); //från höger
|
||||||
|
go=2;
|
||||||
|
sleep(100);
|
||||||
|
}
|
||||||
|
if (go == 1) { //Tåget väntar i krysset
|
||||||
|
if (mod2 & 0x0040 || mod2 & 0x4000 || mod1 & 0x0080 ||
|
||||||
|
mod1 & 0x4000 || mod1 & 0x8000 || mod1 & 0x0001 ) {
|
||||||
|
switch_close(2);
|
||||||
|
sleep(100);
|
||||||
|
train_set_speed(Train8, SPEED);
|
||||||
|
go=0;
|
||||||
|
sleep(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (go == 2) { //Tåget väntar i krysset
|
||||||
|
if (mod1 & 0x0001 ||mod1 & 0x0002 || mod1 & 0x0008 ||
|
||||||
|
mod2 & 0x0004 || mod2 & 0x0008 || mod2 & 0x0010 ) {
|
||||||
|
switch_open(2);
|
||||||
|
sleep(100);
|
||||||
|
train_set_speed(Train8, SPEED);
|
||||||
|
go=0;
|
||||||
|
sleep(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# dummy()
|
||||||
|
//# Den röda dummytrådens funktion.
|
||||||
|
void dummy() {
|
||||||
|
halWrite("\nDummy thread running...");
|
||||||
|
}
|
||||||
|
|
||||||
|
//#
|
||||||
|
//# main()
|
||||||
|
//# Initierar Rubus och avbryter om
|
||||||
|
//# om något går fel.
|
||||||
|
void main(void) {
|
||||||
|
halWrite("\nProgrammet startades!\n");
|
||||||
|
|
||||||
|
if (halInit() != RCODE_OK)
|
||||||
|
halHalt();
|
||||||
|
if (bsInit(OBJECT_BASIC_QUEUE | _RO_RESET) != RCODE_OK)
|
||||||
|
halHalt();
|
||||||
|
if (redInit(&redSchedule) != RCODE_OK)
|
||||||
|
halHalt();
|
||||||
|
if (blueInit(OBJECT_BLUE_MUTEX | OBJECT_BLUE_MSG | OBJECT_BLUE_THREAD | _RO_RESET) != RCODE_OK)
|
||||||
|
halHalt();
|
||||||
|
|
||||||
|
halBsTimerStart();
|
||||||
|
blueStart();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
GAMMAL KOD
|
||||||
|
|
||||||
|
TYPE_TIME startTime, stopTime, timePeriod;
|
||||||
|
timePeriod = bsTvToJiffies((bsPosixTime_t *)&timeSec);
|
||||||
|
|
||||||
|
printf("start");
|
||||||
|
if(!train_init()) halHalt();
|
||||||
|
printf("stopp");
|
||||||
|
bsClockGetTime(&startTime);
|
||||||
|
|
||||||
|
|
||||||
|
while(1) {printf("hey");};
|
||||||
|
stopTrain();
|
||||||
|
halWrite("\nProgrammet avslutades...");
|
||||||
|
halExit();
|
||||||
|
|
||||||
|
void readSensor(uint mod1, uint mod2) {
|
||||||
|
halWrite("\nREAD_SENSOR");
|
||||||
|
mod1 = sensor_read(1);
|
||||||
|
sleep(100);
|
||||||
|
mod2 = sensor_read(2);
|
||||||
|
|
||||||
|
if(mod1 & 1) { halWrite("\n mod:1 & __1__\n"); }
|
||||||
|
else if(mod1 & 2) { halWrite("\n mod:1 & __2__\n"); }
|
||||||
|
else if(mod1 & 3) { halWrite("\n mod:1 & __3__\n"); }
|
||||||
|
else if(mod1 & 4) { halWrite("\n mod:1 & __4__\n"); }
|
||||||
|
else if(mod1 & 5) { halWrite("\n mod:1 & __5__\n"); }
|
||||||
|
else if(mod1 & 6) { halWrite("\n mod:1 & __6__\n"); }
|
||||||
|
else if(mod1 & 7) { halWrite("\n mod:1 & __7__\n"); }
|
||||||
|
else if(mod1 & 8) { halWrite("\n mod:1 & __8__\n"); }
|
||||||
|
else if(mod1 & 9) { halWrite("\n mod:1 & __9__\n"); }
|
||||||
|
else if(mod1 & 10) { halWrite("\n mod:1 & __10_\n"); }
|
||||||
|
else if(mod2 & 1) { halWrite("\n mod:2 & __1__\n"); }
|
||||||
|
else if(mod2 & 2) { halWrite("\n mod:2 & __2__\n"); }
|
||||||
|
else if(mod2 & 3) { halWrite("\n mod:2 & __3__\n"); }
|
||||||
|
else if(mod2 & 4) { halWrite("\n mod:2 & __4__\n"); }
|
||||||
|
else if(mod2 & 5) { halWrite("\n mod:2 & __5__\n"); }
|
||||||
|
else if(mod2 & 6) { halWrite("\n mod:2 & __6__\n"); }
|
||||||
|
else if(mod2 & 7) { halWrite("\n mod:2 & __7__\n"); }
|
||||||
|
else if(mod2 & 8) { halWrite("\n mod:2 & __8__\n"); }
|
||||||
|
else if(mod2 & 9) { halWrite("\n mod:2 & __9__\n"); }
|
||||||
|
else if(mod2 & 10) { halWrite("\n mod:2 & __10_\n"); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//Begin stop (old try...)
|
||||||
|
if(mod1 & 0x0020 || mod2 & 0x0001) {
|
||||||
|
train_set_speed(Train8, 0);
|
||||||
|
halWrite("\nStoppar tåg 78");
|
||||||
|
sleep(100);
|
||||||
|
switch_close(2);
|
||||||
|
set = 1;
|
||||||
|
}
|
||||||
|
if(set == 1)
|
||||||
|
if(mod1 != 0 || mod2 != 0)
|
||||||
|
if(!(mod1 & 0x0008) && !(mod2 & 0x0004) && !(mod2 & 0x0002)){
|
||||||
|
train_set_speed(Train8, 8);
|
||||||
|
halWrite("\nstartar tåg 78");
|
||||||
|
sleep(100);
|
||||||
|
switch_open(2);
|
||||||
|
set = 0;
|
||||||
|
}
|
||||||
|
if(mod1 & 0x0020 || mod2 & 0x0001) {
|
||||||
|
train_set_speed(Train8, 0);
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
15
mount_train.txt
Normal file
15
mount_train.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
elab-tr1 för bana närmast fönster
|
||||||
|
|
||||||
|
elab-tr2 för bana närmast dörr
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Enhet
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
Koppla upp enhet...
|
||||||
|
|
||||||
|
net use * \\elab-tr1.cse.kau.se\labarea /USER:elab-tr1\train
|
||||||
|
|
||||||
|
password:märklin
|
||||||
9
msg.h
Normal file
9
msg.h
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef __MSG_H__
|
||||||
|
#define __MSG_H__
|
||||||
|
#define SIZE_MONITOR_BUFFER 120
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
TYPE_TIME t;
|
||||||
|
INT seq_nr;
|
||||||
|
} msg_t;
|
||||||
|
#endif
|
||||||
21
schedule.cfg
Normal file
21
schedule.cfg
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MODULE schedule;
|
||||||
|
%{
|
||||||
|
#include "msg.h"
|
||||||
|
%}
|
||||||
|
|
||||||
|
BASICRES 1 ms;
|
||||||
|
BLUEPRESCALE 1;
|
||||||
|
|
||||||
|
BLUEKERNELSTACK 30000;
|
||||||
|
BLUEIDLESTACK 30000;
|
||||||
|
|
||||||
|
BLUETHREAD A ENTRY blueFunk STACKSIZE 22000 PRIORITY 13;
|
||||||
|
|
||||||
|
REDTHREAD Dummy ENTRY dummy;
|
||||||
|
|
||||||
|
REDSTACKSIZE 500;
|
||||||
|
|
||||||
|
SCHEDULE redSchedule PERIODTIME 10000;
|
||||||
|
RELEASETIME 9990;
|
||||||
|
Dummy DEADLINE 10000;
|
||||||
|
|
||||||
30
sensor.c
Normal file
30
sensor.c
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
//#
|
||||||
|
//# sensor.c
|
||||||
|
//#
|
||||||
|
//# =======================================================
|
||||||
|
//# Lab i realtidssystem
|
||||||
|
//# Styrning av tåg
|
||||||
|
//#
|
||||||
|
//#
|
||||||
|
//# Christian Ohlsson, Karlstads universitet
|
||||||
|
//# 990922
|
||||||
|
//# =======================================================
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include "train.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
typedef enum banDel {
|
||||||
|
r11=0x0002, r12=0x0008, r13=0x0004,
|
||||||
|
r21=0x0080, r22=0x4000, r23=0x0040,
|
||||||
|
k11=0x, k12=0x, k13=0x,
|
||||||
|
k21=0x, k22=0x, k23=0x,
|
||||||
|
m11=0x, m12=0x, m13=0x, m14=0x,
|
||||||
|
m21=0x, m22=0x, m23=0x, m24=0x
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
extern void halWrite();
|
||||||
|
|
||||||
|
void p2Main() {
|
||||||
|
;
|
||||||
|
}
|
||||||
34
taglab_b.h
Normal file
34
taglab_b.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef _TAGLAB_B_H_
|
||||||
|
#define _TAGLAB_B_H_
|
||||||
|
/*
|
||||||
|
** Generated by RubusCB 2.1 Jun 16 1999 09:44:36 License Release
|
||||||
|
**
|
||||||
|
** File: taglab_b.h
|
||||||
|
**
|
||||||
|
** Created: 11:05:24 October 12 1999
|
||||||
|
**
|
||||||
|
** File is automatically generated, DO NOT EDIT!
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
#include <blue/b_thread.h>
|
||||||
|
#include <basic/bs_log.h>
|
||||||
|
|
||||||
|
#include "msg.h"
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern blueThreadAttr_t const blueIdle;
|
||||||
|
extern blueThreadAttr_t const A;
|
||||||
|
extern blueThreadAttr_t const blueKernel;
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
29
taglab_bs.h
Normal file
29
taglab_bs.h
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef _TAGLAB_BS_H_
|
||||||
|
#define _TAGLAB_BS_H_
|
||||||
|
/*
|
||||||
|
** Generated by RubusCB 2.1 Jun 16 1999 09:44:36 License Release
|
||||||
|
**
|
||||||
|
** File: taglab_bs.h
|
||||||
|
**
|
||||||
|
** Created: 11:05:24 October 12 1999
|
||||||
|
**
|
||||||
|
** File is automatically generated, DO NOT EDIT!
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
|
||||||
|
#include "msg.h"
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
36
taglab_c.c
Normal file
36
taglab_c.c
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
** Generated by RubusCB 2.1 Jun 16 1999 09:44:36 License Release
|
||||||
|
**
|
||||||
|
** File: taglab_c.c
|
||||||
|
**
|
||||||
|
** Created: 11:05:24 October 12 1999
|
||||||
|
**
|
||||||
|
** File is automatically generated, DO NOT EDIT!
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
#include <red/r_thread.h>
|
||||||
|
#include <red/r_cfg.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "taglab_r.h"
|
||||||
|
|
||||||
|
|
||||||
|
#include "msg.h"
|
||||||
|
|
||||||
|
extern void redSchedule_9990(void);
|
||||||
|
void redSchedule_0(void)
|
||||||
|
|
||||||
|
{
|
||||||
|
redEnterSchedule();
|
||||||
|
redNext(redSchedule_9990,9990);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern void redSchedule_0(void);
|
||||||
|
void redSchedule_9990(void)
|
||||||
|
|
||||||
|
{
|
||||||
|
redNext(redSchedule_0,10000);
|
||||||
|
redExecute(&Dummy_1);
|
||||||
|
}
|
||||||
|
|
||||||
57
taglab_d.c
Normal file
57
taglab_d.c
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
** Generated by RubusCB 2.1 Jun 16 1999 09:44:36 License Release
|
||||||
|
**
|
||||||
|
** File: taglab_d.c
|
||||||
|
**
|
||||||
|
** Created: 11:05:24 October 12 1999
|
||||||
|
**
|
||||||
|
** File is automatically generated, DO NOT EDIT!
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
#include <red/r_thread.h>
|
||||||
|
#include <red/r_cfg.h>
|
||||||
|
#include <blue/b_thread.h>
|
||||||
|
#include <basic/bs_log.h>
|
||||||
|
#include <hal/hal_cfg.h>
|
||||||
|
#include "taglab_bs.h"
|
||||||
|
#include "taglab_r.h"
|
||||||
|
#include "taglab_b.h"
|
||||||
|
|
||||||
|
#include "msg.h"
|
||||||
|
|
||||||
|
|
||||||
|
TYPE_CB LOC_CB DummyCB[(SIZE_RED_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
struct{
|
||||||
|
bsStack_t header;
|
||||||
|
UINT stack[(500 + sizeof(UINT) - 1) / sizeof(UINT)];
|
||||||
|
}redStack;
|
||||||
|
|
||||||
|
TYPE_CB LOC_CB redStackFrame[((SIZE_RED_FRAME_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)) * (SIZE_RED_NESTED_LEVELS + 1)];
|
||||||
|
|
||||||
|
TYPE_CB LOC_CB * LOC_CB blueIntrTable[4];
|
||||||
|
TYPE_CB LOC_CB * LOC_CB * const blueIntrTableTop = &blueIntrTable[0];
|
||||||
|
TYPE_CB LOC_CB * LOC_CB * const blueIntrTableBottom = &blueIntrTable[3];
|
||||||
|
|
||||||
|
struct {
|
||||||
|
bsStack_t header;
|
||||||
|
UINT stack[(30000 + sizeof(UINT) - 1) / sizeof(UINT)];
|
||||||
|
}blueIdleStack;
|
||||||
|
|
||||||
|
TYPE_CB LOC_CB blueIdleCB[(SIZE_BLUE_THREAD_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
struct {
|
||||||
|
bsStack_t header;
|
||||||
|
UINT stack[(22000 + sizeof(UINT) - 1) / sizeof(UINT)];
|
||||||
|
}AStack;
|
||||||
|
|
||||||
|
TYPE_CB LOC_CB ACB[(SIZE_BLUE_THREAD_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
struct {
|
||||||
|
bsStack_t header;
|
||||||
|
UINT stack[(30000 + sizeof(UINT) - 1) / sizeof(UINT)];
|
||||||
|
}blueKernelStack;
|
||||||
|
|
||||||
|
TYPE_CB LOC_CB blueKernelCB[(SIZE_BLUE_THREAD_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
14
taglab_m.map
Normal file
14
taglab_m.map
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
101 ID 6 NAME bsClockBasic BASICRES 1000000 BLUEPRESCALE 1
|
||||||
|
102 ID 7 NAME bsLog SIZE 0
|
||||||
|
203 ID 4 NAME Dummy
|
||||||
|
201 ID 12 NAME RedStack SIZE 500
|
||||||
|
204 ID 13 NAME 1 THREAD 4 SCHEDULE 5 REL 9990 DLN 10000
|
||||||
|
202 ID 5 NAME redSchedule PERIODTIME 10000
|
||||||
|
104 ID 10 NAME redScheduleAttrList
|
||||||
|
302 ID 2 NAME blueIdle PRI 0 STACK 30000
|
||||||
|
302 ID 3 NAME A PRI 13 STACK 22000
|
||||||
|
302 ID 1 NAME blueKernel PRI 15 STACK 30000
|
||||||
|
104 ID 14 NAME blueThreadAttrList
|
||||||
|
104 ID 16 NAME blueMsgAttrList
|
||||||
|
104 ID 17 NAME blueMutexAttrList
|
||||||
|
|
||||||
34
taglab_r.h
Normal file
34
taglab_r.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
#ifndef _TAGLAB_R_H_
|
||||||
|
#define _TAGLAB_R_H_
|
||||||
|
/*
|
||||||
|
** Generated by RubusCB 2.1 Jun 16 1999 09:44:36 License Release
|
||||||
|
**
|
||||||
|
** File: taglab_r.h
|
||||||
|
**
|
||||||
|
** Created: 11:05:24 October 12 1999
|
||||||
|
**
|
||||||
|
** File is automatically generated, DO NOT EDIT!
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
#include <red/r_thread.h>
|
||||||
|
#include <red/r_cfg.h>
|
||||||
|
|
||||||
|
#include "msg.h"
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern redThreadBaseAttr_t const Dummy;
|
||||||
|
extern redThreadInstAttr_t const Dummy_1;
|
||||||
|
extern redSchedAttr_t const redSchedule;
|
||||||
|
|
||||||
|
#ifdef COMP_CPLUSPLUS
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
147
taglab_s.c
Normal file
147
taglab_s.c
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
** Generated by RubusCB 2.1 Jun 16 1999 09:44:36 License Release
|
||||||
|
**
|
||||||
|
** File: taglab_s.c
|
||||||
|
**
|
||||||
|
** Created: 11:05:24 October 12 1999
|
||||||
|
**
|
||||||
|
** File is automatically generated, DO NOT EDIT!
|
||||||
|
**
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <basic/bs_basic.h>
|
||||||
|
#include <red/r_thread.h>
|
||||||
|
#include <red/r_cfg.h>
|
||||||
|
#include <blue/b_thread.h>
|
||||||
|
#include <basic/bs_log.h>
|
||||||
|
#include <hal/hal_cfg.h>
|
||||||
|
#include "taglab_bs.h"
|
||||||
|
#include "taglab_r.h"
|
||||||
|
#include "taglab_b.h"
|
||||||
|
|
||||||
|
#include "msg.h"
|
||||||
|
|
||||||
|
bsLabel_t const bsCBLabel = (UCHAR const *)"RubusCB 2.1 Jun 16 1999 09:44:36 License Release\n";
|
||||||
|
bsLabel_t const bsCRLabel = (UCHAR const *)"Copyright 1995-1999 Arcticus Systems AB All Rights Reserved\n";
|
||||||
|
bsProductLabel_t const bsProductLabel ={
|
||||||
|
(bsLabel_t)&bsOSLabel,
|
||||||
|
(bsLabel_t)&bsCBLabel,
|
||||||
|
(bsLabel_t)&bsCRLabel,
|
||||||
|
0xf278,
|
||||||
|
0xadc6,
|
||||||
|
};
|
||||||
|
|
||||||
|
bsClockAttr_t const bsClockBasicAttr ={
|
||||||
|
{{NULLP},(bsName_t)"Clock Basic",OBJECT_BASIC_CLOCK,6},
|
||||||
|
BASIC_NSEC/1000000L,
|
||||||
|
1000000L,
|
||||||
|
1,
|
||||||
|
};
|
||||||
|
|
||||||
|
bsLogAttr_t const bsLogAttr ={
|
||||||
|
{{NULLP},(bsName_t)"bsLog",OBJECT_BASIC_LOG,7},
|
||||||
|
0,
|
||||||
|
NULLP,
|
||||||
|
NULLP,
|
||||||
|
};
|
||||||
|
|
||||||
|
bsNodeS_t const bsQueueAttrList ={
|
||||||
|
{NULLP},(bsName_t)"BASIC QUEUE LIST",0,9
|
||||||
|
};
|
||||||
|
|
||||||
|
extern TYPE_CB LOC_CB DummyCB[(SIZE_RED_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
redThreadBaseAttr_t const Dummy = {
|
||||||
|
{{NULLP},(bsName_t)"Dummy",OBJECT_RED_THREAD_BASE,4},
|
||||||
|
(TYPE_CB LOC_CB *)&DummyCB,
|
||||||
|
};
|
||||||
|
|
||||||
|
bsNodeS_t const redThreadBaseAttrList = {
|
||||||
|
{(bsLinkS_t *)&Dummy},(bsName_t)"RED THREAD BASE LIST",OBJECT_RED_THREAD_BASE,11
|
||||||
|
};
|
||||||
|
|
||||||
|
extern bsStack_t redStack;
|
||||||
|
extern TYPE_CB LOC_CB redStackFrame[((SIZE_RED_FRAME_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)) * (SIZE_RED_NESTED_LEVELS + 1)];
|
||||||
|
|
||||||
|
redStackAttr_t const redStackAttr={
|
||||||
|
{{NULLP},(bsName_t)"RED STACK",OBJECT_RED_STACK,12},
|
||||||
|
(500 + sizeof(UINT) - 1) / sizeof(UINT),
|
||||||
|
&redStack,
|
||||||
|
SIZE_RED_NESTED_LEVELS,
|
||||||
|
(TYPE_CB LOC_CB *)&redStackFrame
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void dummy(void);
|
||||||
|
redThreadInstAttr_t const Dummy_1 ={
|
||||||
|
{{NULLP},(bsName_t)"1",OBJECT_RED_THREAD_INST,13},
|
||||||
|
&Dummy,
|
||||||
|
9990,
|
||||||
|
10000,
|
||||||
|
(TYPE_CB LOC_CB *)&DummyCB,
|
||||||
|
(redThread_t)dummy,
|
||||||
|
NULLP,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void redSchedule_0(void);
|
||||||
|
redSchedAttr_t const redSchedule={
|
||||||
|
{{NULLP,(bsLinkD_t *)&Dummy_1},(bsName_t)"redSchedule",OBJECT_RED_SCHEDULE,5},
|
||||||
|
10000,
|
||||||
|
1,
|
||||||
|
redSchedule_0,
|
||||||
|
NULLP,
|
||||||
|
};
|
||||||
|
|
||||||
|
bsNodeS_t const redScheduleAttrList = {
|
||||||
|
{(bsLinkS_t *)&redSchedule},(bsName_t)"RED SCHEDULE LIST",OBJECT_RED_SCHEDULE,10
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void blueIdleMain(VOIDP args);
|
||||||
|
extern TYPE_CB LOC_CB blueIdleCB[(SIZE_BLUE_THREAD_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
extern bsStack_t blueIdleStack;
|
||||||
|
blueThreadAttr_t const blueIdle={
|
||||||
|
{{NULLP},(bsName_t)"blueIdle",OBJECT_BLUE_THREAD,2},
|
||||||
|
(TYPE_CB LOC_CB *)&blueIdleCB,
|
||||||
|
0,
|
||||||
|
blueIdleMain,
|
||||||
|
NULLP,
|
||||||
|
(30000 + sizeof(UINT) - 1) / sizeof(UINT),
|
||||||
|
(bsStack_t *)&blueIdleStack,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void blueFunk(VOIDP args);
|
||||||
|
extern TYPE_CB LOC_CB ACB[(SIZE_BLUE_THREAD_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
extern bsStack_t AStack;
|
||||||
|
blueThreadAttr_t const A={
|
||||||
|
{{(bsLinkS_t *)&blueIdle},(bsName_t)"A",OBJECT_BLUE_THREAD,3},
|
||||||
|
(TYPE_CB LOC_CB *)&ACB,
|
||||||
|
13,
|
||||||
|
blueFunk,
|
||||||
|
NULLP,
|
||||||
|
(22000 + sizeof(UINT) - 1) / sizeof(UINT),
|
||||||
|
(bsStack_t *)&AStack,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern void blueKernelMain(VOIDP args);
|
||||||
|
extern TYPE_CB LOC_CB blueKernelCB[(SIZE_BLUE_THREAD_CB + sizeof(TYPE_CB) - 1) / sizeof(TYPE_CB)];
|
||||||
|
extern bsStack_t blueKernelStack;
|
||||||
|
blueThreadAttr_t const blueKernel={
|
||||||
|
{{(bsLinkS_t *)&A},(bsName_t)"blueKernel",OBJECT_BLUE_THREAD,1},
|
||||||
|
(TYPE_CB LOC_CB *)&blueKernelCB,
|
||||||
|
15,
|
||||||
|
blueKernelMain,
|
||||||
|
NULLP,
|
||||||
|
(30000 + sizeof(UINT) - 1) / sizeof(UINT),
|
||||||
|
(bsStack_t *)&blueKernelStack,
|
||||||
|
};
|
||||||
|
|
||||||
|
bsNodeS_t const blueThreadAttrList = {
|
||||||
|
{(bsLinkS_t *)&blueKernel},(bsName_t)"BLUE THREAD LIST",0,14
|
||||||
|
};
|
||||||
|
|
||||||
|
bsNodeS_t const blueMsgAttrList = {
|
||||||
|
{NULLP},(bsName_t)"BLUE MSG LIST",0,16
|
||||||
|
};
|
||||||
|
|
||||||
|
bsNodeS_t const blueMutexAttrList = {
|
||||||
|
{NULLP},(bsName_t)"BLUE MX LIST",0,17
|
||||||
|
};
|
||||||
|
|
||||||
Reference in New Issue
Block a user