diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000000..d855f99c8c --- /dev/null +++ b/.hgignore @@ -0,0 +1,24 @@ +# auto-generated from .gitignore files by build-hgignore.py +syntax: re +^\.hgignore$ +.*/.*~$ # '*~' in 'eclipse-plugins' +eclipse-plugins/.*/target(?:/|$) # 'target/' in 'eclipse-plugins' +eclipse-plugins/.*/bin(?:/|$) # 'bin/' in 'eclipse-plugins' +eclipse-plugins/.*/\.settings(?:/|$) # '.settings/' in 'eclipse-plugins' +networktables/.*/target(?:/|$) # 'target/' in 'networktables' +networktables/.*/build(?:/|$) # 'build/' in 'networktables' +networktables/.*/dist(?:/|$) # 'dist/' in 'networktables' +^networktables/OutlineViewer/nbproject/private(?:/|$) # '/OutlineViewer/nbproject/private/' in 'networktables' +maven-utilities/.*/target(?:/|$) # 'target/' in 'maven-utilities' +hal/.*/.*#$ # '*#' in 'hal' +hal/.*/PPC603gnu(?:/|$) # 'PPC603gnu/' in 'hal' +hal/.*/Debug(?:/|$) # 'Debug/' in 'hal' +hal/.*/target(?:/|$) # 'target/' in 'hal' +hal/.*/tmp(?:/|$) # 'tmp/' in 'hal' +hal/.*/GPATH$ # 'GPATH' in 'hal' +hal/.*/GRTAGS$ # 'GRTAGS' in 'hal' +hal/.*/GSYMS$ # 'GSYMS' in 'hal' +hal/.*/GTAGS$ # 'GTAGS' in 'hal' +ni-libraries/.*/target(?:/|$) # 'target/' in 'ni-libraries' +wpilib.?/.*/target(?:/|$) + diff --git a/arm-toolchain.cmake b/arm-toolchain.cmake new file mode 100644 index 0000000000..3a278ba21f --- /dev/null +++ b/arm-toolchain.cmake @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8) +INCLUDE(CMakeForceCompiler) +set(ARM_PREFIX arm-linux-gnueabi) +set(CMAKE_SYSTEM_NAME Linux) +CMAKE_FORCE_CXX_COMPILER(${ARM_PREFIX}-g++ GNU) +set(CMAKE_CXX_FLAGS "-march=armv7-a -mcpu=cortex-a9 -mfloat-abi=softfp -Wall" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3" CACHE STRING "" FORCE) +set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g" CACHE STRING "" FORCE) # still want debugging for release? +SET(CMAKE_FIND_ROOT_PATH /home/patrick/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/arm-none-linux-gnueabi/libc) diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/META-INF/MANIFEST.MF b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/META-INF/MANIFEST.MF index 7121a5cbec..b321588db9 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/META-INF/MANIFEST.MF +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/META-INF/MANIFEST.MF @@ -29,3 +29,4 @@ Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: JavaSE-1.7 Export-Package: edu.wpi.first.wpilib.plugins.cpp, edu.wpi.first.wpilib.plugins.cpp.preferences +Bundle-Vendor: WPI & FIRST diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.cpp index 92a24a2644..474040ab1b 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.cpp @@ -1,31 +1,38 @@ #include "$classname.h" -$classname::$classname() { +$classname::$classname() +{ // Use Requires() here to declare subsystem dependencies // eg. Requires(chassis); } // Called just before this Command runs the first time -void $classname::Initialize() { - +void $classname::Initialize() +{ + } // Called repeatedly when this Command is scheduled to run -void $classname::Execute() { - +void $classname::Execute() +{ + } // Make this return true when this Command no longer needs to run execute() -bool $classname::IsFinished() { +bool $classname::IsFinished() +{ return false; } // Called once after isFinished returns true -void $classname::End() { - +void $classname::End() +{ + } // Called when another command which requires one or more of the same // subsystems is scheduled to run -void $classname::Interrupted() { +void $classname::Interrupted() +{ + } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.h index 768daa47e7..b234d35ae1 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Command.h @@ -3,19 +3,15 @@ #include "../CommandBase.h" -/** - * - * - * @author ExampleAuthor - */ -class $classname: public CommandBase { +class $classname: public CommandBase +{ public: $classname(); - virtual void Initialize(); - virtual void Execute(); - virtual bool IsFinished(); - virtual void End(); - virtual void Interrupted(); + void Initialize(); + void Execute(); + bool IsFinished(); + void End(); + void Interrupted(); }; #endif diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.cpp index c89014b938..61496bfa75 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.cpp @@ -2,20 +2,26 @@ #include "Subsystems/ExampleSubsystem.h" #include "Commands/Scheduler.h" -CommandBase::CommandBase(const char *name) : Command(name) { -} - -CommandBase::CommandBase() : Command() { -} - // Initialize a single static instance of all of your subsystems to NULL ExampleSubsystem* CommandBase::examplesubsystem = NULL; OI* CommandBase::oi = NULL; -void CommandBase::init() { - // Create a single static instance of all of your subsystems. The following +CommandBase::CommandBase(std::string name) : + Command(name) +{ +} + +CommandBase::CommandBase() : + Command() +{ + +} + +void CommandBase::init() +{ + // Create a single static instance of all of your subsystems. The following // line should be repeated for each subsystem in the project. examplesubsystem = new ExampleSubsystem(); - + oi = new OI(); } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.h index e300f088cc..96c6a8b4c5 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandBase.h @@ -1,19 +1,20 @@ #ifndef COMMAND_BASE_H #define COMMAND_BASE_H +#include #include "Commands/Command.h" #include "Subsystems/ExampleSubsystem.h" #include "OI.h" - /** * The base for all commands. All atomic commands should subclass CommandBase. * CommandBase stores creates and stores each control system. To access a * subsystem elsewhere in your code in your code use CommandBase.examplesubsystem */ -class CommandBase: public Command { +class CommandBase: public Command +{ public: - CommandBase(const char *name); + CommandBase(std::string name); CommandBase(); static void init(); // Create a single static instance of all of your subsystems diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.cpp index d31408bc2f..664b44bdeb 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.cpp @@ -1,7 +1,7 @@ - #include "$classname.h" -$classname::$classname() { +$classname::$classname() +{ // Add Commands here: // e.g. AddSequential(new Command1()); // AddSequential(new Command2()); diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.h index fe723d6ad5..b86ae9aca0 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/CommandGroup.h @@ -1,16 +1,11 @@ - #ifndef $classname_H #define $classname_H #include "Commands/CommandGroup.h" -/** - * - * - * @author ExampleAuthor - */ -class $classname: public CommandGroup { -public: +class $classname: public CommandGroup +{ +public: $classname(); }; diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.cpp index 15bdf215e9..e239f026fa 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.cpp @@ -1,31 +1,38 @@ #include "ExampleCommand.h" -ExampleCommand::ExampleCommand() { +ExampleCommand::ExampleCommand() +{ // Use Requires() here to declare subsystem dependencies // eg. Requires(chassis); } // Called just before this Command runs the first time -void ExampleCommand::Initialize() { - +void ExampleCommand::Initialize() +{ + } // Called repeatedly when this Command is scheduled to run -void ExampleCommand::Execute() { - +void ExampleCommand::Execute() +{ + } // Make this return true when this Command no longer needs to run execute() -bool ExampleCommand::IsFinished() { +bool ExampleCommand::IsFinished() +{ return false; } // Called once after isFinished returns true -void ExampleCommand::End() { - +void ExampleCommand::End() +{ + } // Called when another command which requires one or more of the same // subsystems is scheduled to run -void ExampleCommand::Interrupted() { +void ExampleCommand::Interrupted() +{ + } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.h index 50ad6a3065..0e7e52a467 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleCommand.h @@ -3,19 +3,15 @@ #include "../CommandBase.h" -/** - * - * - * @author ExampleAuthor - */ -class ExampleCommand: public CommandBase { +class ExampleCommand: public CommandBase +{ public: ExampleCommand(); - virtual void Initialize(); - virtual void Execute(); - virtual bool IsFinished(); - virtual void End(); - virtual void Interrupted(); + void Initialize(); + void Execute(); + bool IsFinished(); + void End(); + void Interrupted(); }; #endif diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.cpp index 21d8e636d8..2878b01a19 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.cpp @@ -1,16 +1,17 @@ #include "ExampleSubsystem.h" -#include "../Robotmap.h" +#include "../RobotMap.h" +ExampleSubsystem::ExampleSubsystem() : + Subsystem("ExampleSubsystem") +{ -ExampleSubsystem::ExampleSubsystem() : Subsystem("ExampleSubsystem") { - } - -void ExampleSubsystem::InitDefaultCommand() { + +void ExampleSubsystem::InitDefaultCommand() +{ // Set the default command for a subsystem here. //SetDefaultCommand(new MySpecialCommand()); } - // Put methods for controlling this subsystem // here. Call these from Commands. diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.h index 4f88ff0200..06149d0ab8 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/ExampleSubsystem.h @@ -1,14 +1,11 @@ #ifndef EXAMPLE_SUBSYSTEM_H #define EXAMPLE_SUBSYSTEM_H + #include "Commands/Subsystem.h" #include "WPILib.h" -/** - * - * - * @author ExampleAuthor - */ -class ExampleSubsystem: public Subsystem { +class ExampleSubsystem: public Subsystem +{ private: // It's desirable that everything possible under private except // for methods that implement subsystem capabilities diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.cpp index 06eda9aa19..7c0a7c8f02 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.cpp @@ -1,5 +1,6 @@ #include "OI.h" -OI::OI() { +OI::OI() +{ // Process operator interface input here. } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.h index 7a2ab97996..70855a103f 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/OI.h @@ -3,7 +3,8 @@ #include "WPILib.h" -class OI { +class OI +{ private: public: diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.cpp index 3d64f689c4..be88166533 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.cpp @@ -1,31 +1,35 @@ - #include "$classname.h" -#include "../Robotmap.h" +#include "../RobotMap.h" #include "SmartDashboard/SmartDashboard.h" #include "LiveWindow/LiveWindow.h" #@autogenerated_code("pid", "") #parse("${exporter-path}PIDSubsystem-pid.cpp") #end -$classname::$classname() : PIDSubsystem("$classname", 1.0, 0.0, 0.0) { +$classname::$classname() : + PIDSubsystem("$classname", 1.0, 0.0, 0.0) +{ // Use these to get going: // SetSetpoint() - Sets where the PID controller should move the system // to // Enable() - Enables the PID controller. } -double $classname::ReturnPIDInput() { +double $classname::ReturnPIDInput() +{ // Return your input value for the PID loop // e.g. a sensor, like a potentiometer: // yourPot->SetAverageVoltage() / kYourMaxVoltage; } -void $classname::UsePIDOutput(double output) { +void $classname::UsePIDOutput(double output) +{ // Use output to drive your system, like a motor // e.g. yourMotor->Set(output); } -void $classname::InitDefaultCommand() { +void $classname::InitDefaultCommand() +{ // Set the default command for a subsystem here. //setDefaultCommand(new MySpecialCommand()); } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.h index 8dc603fd51..ffb573a3de 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/PIDSubsystem.h @@ -1,17 +1,12 @@ - #ifndef $classname_H #define $classname_H #include "Commands/PIDSubsystem.h" #include "WPILib.h" -/** - * - * - * @author ExampleAuthor - */ -class $classname: public PIDSubsystem { - public: +class $classname: public PIDSubsystem +{ +public: $classname(); double ReturnPIDInput(); void UsePIDOutput(double output); diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp index 07e201c8c5..6abddda7d5 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp @@ -1,48 +1,47 @@ -//============================================================================ -// Name : Robot.cpp -// Author : -// Version : -// Copyright : -// Description : Hello World in C++, Ansi-style -//============================================================================ - #include "WPILib.h" #include "Commands/Command.h" #include "Commands/ExampleCommand.h" #include "CommandBase.h" -class Robot : public IterativeRobot { +class Robot: public IterativeRobot +{ private: Command *autonomousCommand; LiveWindow *lw; - - virtual void RobotInit() { + + void RobotInit() + { CommandBase::init(); autonomousCommand = new ExampleCommand(); lw = LiveWindow::GetInstance(); } - - virtual void AutonomousInit() { + + void AutonomousInit() + { autonomousCommand->Start(); } - - virtual void AutonomousPeriodic() { + + void AutonomousPeriodic() + { Scheduler::GetInstance()->Run(); } - - virtual void TeleopInit() { + + void TeleopInit() + { // This makes sure that the autonomous stops running when // teleop starts running. If you want the autonomous to // continue until interrupted by another command, remove // this line or comment it out. autonomousCommand->Cancel(); } - - virtual void TeleopPeriodic() { + + void TeleopPeriodic() + { Scheduler::GetInstance()->Run(); } - - virtual void TestPeriodic() { + + void TestPeriodic() + { lw->Run(); } }; diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/RobotMap.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/RobotMap.h index fa48c742d1..61f189678d 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/RobotMap.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/RobotMap.h @@ -11,12 +11,12 @@ // For example to map the left and right motors, you could define the // following variables to use with your drivetrain subsystem. -// #define LEFTMOTOR 1 -// #define RIGHTMOTOR 2 +//const int LEFTMOTOR = 1; +//const int RIGHTMOTOR = 2; // If you are using multiple modules, make sure to define both the port // number and the module. For example you with a rangefinder: -// #define RANGE_FINDER_PORT 1 -// #define RANGE_FINDER_MODULE 1 +//const int RANGE_FINDER_PORT = 1; +//const int RANGE_FINDER_MODULE = 1; #endif diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.cpp index 06e0a13e5d..0145f08d6f 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.cpp @@ -1,15 +1,17 @@ #include "$classname.h" -#include "../Robotmap.h" +#include "../RobotMap.h" + +$classname::$classname() : + Subsystem("ExampleSubsystem") +{ -$classname::$classname() : Subsystem("ExampleSubsystem") { - } - -void $classname::InitDefaultCommand() { + +void $classname::InitDefaultCommand() +{ // Set the default command for a subsystem here. //SetDefaultCommand(new MySpecialCommand()); } - // Put methods for controlling this subsystem // here. Call these from Commands. diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.h index d059c25df6..fbc88af275 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Subsystem.h @@ -1,14 +1,11 @@ #ifndef $classname_H #define $classname_H + #include "Commands/Subsystem.h" #include "WPILib.h" -/** - * - * - * @author ExampleAuthor - */ -class $classname: public Subsystem { +class $classname: public Subsystem +{ private: // It's desirable that everything possible under private except // for methods that implement subsystem capabilities diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.cpp index d24a1bf794..7169ecb480 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.cpp @@ -1,13 +1,15 @@ // TODO: convert into C++ template - +#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up" import edu.wpi.first.wpilibj.command.Trigger; /** * New and improved C++ */ -public class $classname extends Trigger { - - public boolean get() { - return false; - } +public class $classname extends Trigger +{ +public: + bool get() + { + return false; + } } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.h b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.h index d24a1bf794..c85dfad622 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.h +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Trigger.h @@ -1,13 +1,9 @@ // TODO: convert into C++ template - +#error "This is not a C++ file. I have no idea what this is doing here, so I'm leaving this message here to let someone else clean this up" import edu.wpi.first.wpilibj.command.Trigger; -/** - * New and improved C++ - */ -public class $classname extends Trigger { - - public boolean get() { - return false; - } +public class $classname extends Trigger +{ +public: + bool get(); } diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/examples/Network Table Counter/Robot.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/examples/Network Table Counter/Robot.cpp index 668db9c756..41a0274a84 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/examples/Network Table Counter/Robot.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/examples/Network Table Counter/Robot.cpp @@ -1,29 +1,23 @@ -//============================================================================ -// Name : Robot.cpp -// Author : -// Version : -// Copyright : -// Description : Hello World in C++, Ansi-style -//============================================================================ - #include #include using namespace std; // This is a simple robot program -int main() { +int main() +{ NetworkTable::SetServerMode(); NetworkTable::SetTeam(190); NetworkTable* table = NetworkTable::GetTable("SmartDashboard"); cout << "Started up" << endl; long i = 0; - while (true) { + while (true) + { cout << i << endl; - table->PutNumber("i", i); - i++; + table->PutNumber("i", i); + i++; - sleep(1); + sleep(1); } return 0; diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/iterative/Robot.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/iterative/Robot.cpp index 50819b5fc2..92d1106faa 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/iterative/Robot.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/iterative/Robot.cpp @@ -1,46 +1,37 @@ -//============================================================================ -// Name : Robot.cpp -// Author : -// Version : -// Copyright : -// Description : Hello World in C++, Ansi-style -//============================================================================ - -//============================================================================ -// Name : Robot.cpp -// Author : -// Version : -// Copyright : -// Description : Hello World in C++, Ansi-style -//============================================================================ - #include "WPILib.h" -class Robot : public IterativeRobot { +class Robot: public IterativeRobot +{ private: LiveWindow *lw; - - virtual void RobotInit() { + + void RobotInit() + { lw = LiveWindow::GetInstance(); } - - virtual void AutonomousInit() { + + void AutonomousInit() + { } - - virtual void AutonomousPeriodic() { + + void AutonomousPeriodic() + { } - - virtual void TeleopInit() { - - } - - virtual void TeleopPeriodic() { + + void TeleopInit() + { } - - virtual void TestPeriodic() { + + void TeleopPeriodic() + { + + } + + void TestPeriodic() + { lw->Run(); } }; diff --git a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/simple/Robot.cpp b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/simple/Robot.cpp index 8c4a7996f8..171a27225a 100644 --- a/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/simple/Robot.cpp +++ b/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/simple/Robot.cpp @@ -1,11 +1,3 @@ -//============================================================================ -// Name : Robot.cpp -// Author : -// Version : -// Copyright : -// Description : Hello World in C++, Ansi-style -//============================================================================ - #include "WPILib.h" /** @@ -13,16 +5,16 @@ * The SimpleRobot class is the base of a robot application that will automatically call your * Autonomous and OperatorControl methods at the right time as controlled by the switches on * the driver station or the field controls. - */ -class Robot : public SimpleRobot + */ +class Robot: public SimpleRobot { RobotDrive myRobot; // robot drive system Joystick stick; // only joystick public: - Robot(void): - myRobot(1, 2), // these must be initialized in the same order - stick(1) // as they are declared above. + Robot() : + myRobot(1, 2), // these must be initialized in the same order + stick(1) // as they are declared above. { myRobot.SetExpiration(0.1); } @@ -30,7 +22,7 @@ public: /** * Drive left & right motors for 2 seconds then stop */ - void Autonomous(void) + void Autonomous() { myRobot.SetSafetyEnabled(false); myRobot.Drive(-0.5, 0.0); // drive forwards half speed @@ -41,7 +33,7 @@ public: /** * Runs the motors with arcade steering. */ - void OperatorControl(void) + void OperatorControl() { myRobot.SetSafetyEnabled(true); while (IsOperatorControl()) @@ -50,11 +42,12 @@ public: Wait(0.005); // wait for a motor update time } } - + /** * Runs during test mode */ - void Test() { + void Test() + { } }; diff --git a/eclipse-plugins/pom.xml b/eclipse-plugins/pom.xml index 03b10ff6b3..1779a4cc25 100644 --- a/eclipse-plugins/pom.xml +++ b/eclipse-plugins/pom.xml @@ -52,15 +52,6 @@ - - jenkins - - - myrepository - file:${local-repository} - - - diff --git a/hal/Athena/src/main/include/NetworkCommunication/FRCComm.h b/hal/Athena/src/main/include/NetworkCommunication/FRCComm.h index e971fac1a5..ae248900ee 100644 --- a/hal/Athena/src/main/include/NetworkCommunication/FRCComm.h +++ b/hal/Athena/src/main/include/NetworkCommunication/FRCComm.h @@ -16,7 +16,11 @@ #ifdef SIMULATION #include +#ifdef USE_THRIFT +#define EXPORT_FUNC +#else #define EXPORT_FUNC __declspec(dllexport) __cdecl +#endif #else #if defined(__vxworks) #include @@ -145,12 +149,14 @@ struct FRCCommonControlData{ #define kFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24 #define kFRC_NetworkCommunication_DynamicType_Kinect_Custom 25 +#ifdef __cplusplus extern "C" { +#endif #ifndef SIMULATION void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision); #endif - int EXPORT_FUNC getCommonControlData(FRCCommonControlData *data, int wait_ms); - int EXPORT_FUNC getRecentCommonControlData(FRCCommonControlData *commonData, int wait_ms); + int EXPORT_FUNC getCommonControlData(struct FRCCommonControlData *data, int wait_ms); + int EXPORT_FUNC getRecentCommonControlData(struct FRCCommonControlData *commonData, int wait_ms); int EXPORT_FUNC getRecentStatusData(uint8_t *batteryInt, uint8_t *batteryDec, uint8_t *dsDigitalOut, int wait_ms); int EXPORT_FUNC getDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms); int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber, @@ -162,7 +168,7 @@ extern "C" { int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms); int EXPORT_FUNC setUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms); int EXPORT_FUNC overrideIOConfig(const char *ioConfig, int wait_ms); - + #ifdef SIMULATION void EXPORT_FUNC setNewDataSem(HANDLE); #else @@ -188,6 +194,8 @@ extern "C" { void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void); void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void); void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void); -}; +#ifdef __cplusplus +} +#endif #endif diff --git a/hal/Athena/src/main/include/NetworkCommunication/JaguarCANDriver.h b/hal/Athena/src/main/include/NetworkCommunication/JaguarCANDriver.h index b466f6d1b6..67797e6063 100644 --- a/hal/Athena/src/main/include/NetworkCommunication/JaguarCANDriver.h +++ b/hal/Athena/src/main/include/NetworkCommunication/JaguarCANDriver.h @@ -14,6 +14,25 @@ #include #include #endif +#ifdef USE_THRIFT +#include "NetCommRPCComm.h" +#include +#endif +namespace nJaguarCANDriver +{ + void sendMessage_wrapper(uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t *status); + void receiveMessage_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, uint32_t timeoutMs, int32_t *status); + int32_t receiveMessageStart_wrapper(uint32_t messageID, uint32_t occurRefNum, uint32_t timeoutMs, int32_t *status); +#if defined (__vxworks) + int32_t receiveMessageStart_sem_wrapper(uint32_t messageID, uint32_t semaphoreID, uint32_t timeoutMs, int32_t *status); +#else + int32_t receiveMessageStart_mutex_wrapper(uint32_t messageID, pthread_mutex_t *mutex, uint32_t timeoutMs, int32_t *status); +#endif + void receiveMessageComplete_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, int32_t *status); +#ifdef USE_THRIFT + void checkEvent_CAN(std::vector< CANEvent >& events); +#endif +} #ifdef __cplusplus extern "C" diff --git a/hal/Athena/src/main/native/ChipObject.h b/hal/Athena/src/main/native/ChipObject.h index 057dbfc48d..45fa2ec78b 100644 --- a/hal/Athena/src/main/native/ChipObject.h +++ b/hal/Athena/src/main/native/ChipObject.h @@ -8,10 +8,13 @@ #define __ChipObject_h__ #include -#include "ChipObject/NiRio.h" #include "ChipObject/RoboRIO_FRC_ChipObject_Aliases.h" -#include "ChipObject/FRC_FPGA_ChipObject_Aliases.h" +#include "ChipObject/tDMAManager.h" +#include "ChipObject/tInterruptManager.h" +#include "ChipObject/tSystem.h" +#include "ChipObject/tSystemInterface.h" +#include "ChipObject/nInterfaceGlobals.h" #include "ChipObject/tAccel.h" #include "ChipObject/tAccumulator.h" #include "ChipObject/tAI.h" @@ -25,11 +28,11 @@ #include "ChipObject/tEncoder.h" #include "ChipObject/tGlobal.h" #include "ChipObject/tInterrupt.h" -#include "ChipObject/tInterruptManager.h" #include "ChipObject/tPower.h" #include "ChipObject/tPWM.h" #include "ChipObject/tRelay.h" -#include "ChipObject/tWatchdog.h" +#include "ChipObject/tSPI.h" +#include "ChipObject/tSysWatchdog.h" using namespace nFPGA; using namespace nRoboRIO_FPGANamespace; diff --git a/hal/Athena/src/main/native/ChipObject/NiRio.h b/hal/Athena/src/main/native/ChipObject/NiRio.h deleted file mode 100644 index ed40bd1a22..0000000000 --- a/hal/Athena/src/main/native/ChipObject/NiRio.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __NiRio_h__ -#define __NiRio_h__ - -#include "fpgainterfacecapi/NiFpga.h" -typedef NiFpga_Status tRioStatusCode; - -#endif // __NiRio_h__ diff --git a/hal/Athena/src/main/native/ChipObject/RoboRIO_FRC_ChipObject_Aliases.h b/hal/Athena/src/main/native/ChipObject/RoboRIO_FRC_ChipObject_Aliases.h index c69ce97ea6..4706240b1f 100644 --- a/hal/Athena/src/main/native/ChipObject/RoboRIO_FRC_ChipObject_Aliases.h +++ b/hal/Athena/src/main/native/ChipObject/RoboRIO_FRC_ChipObject_Aliases.h @@ -4,6 +4,6 @@ #ifndef __RoboRIO_FRC_ChipObject_Aliases_h__ #define __RoboRIO_FRC_ChipObject_Aliases_h__ -#define nRoboRIO_FPGANamespace nFRC_2015_1_0_2 +#define nRoboRIO_FPGANamespace nFRC_2015_1_0_4 #endif // __RoboRIO_FRC_ChipObject_Aliases_h__ diff --git a/hal/Athena/src/main/native/ChipObject/nInterfaceGlobals.h b/hal/Athena/src/main/native/ChipObject/nInterfaceGlobals.h index 4789ec618d..d04a310d8e 100644 --- a/hal/Athena/src/main/native/ChipObject/nInterfaceGlobals.h +++ b/hal/Athena/src/main/native/ChipObject/nInterfaceGlobals.h @@ -1,15 +1,15 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_nInterfaceGlobals_h__ -#define __nFRC_2015_1_0_2_nInterfaceGlobals_h__ +#ifndef __nFRC_2015_1_0_4_nInterfaceGlobals_h__ +#define __nFRC_2015_1_0_4_nInterfaceGlobals_h__ namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { extern unsigned int g_currentTargetClass; } } -#endif // __nFRC_2015_1_0_2_nInterfaceGlobals_h__ +#endif // __nFRC_2015_1_0_4_nInterfaceGlobals_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tAI.h b/hal/Athena/src/main/native/ChipObject/tAI.h index 7169a591a4..24bba65593 100644 --- a/hal/Athena/src/main/native/ChipObject/tAI.h +++ b/hal/Athena/src/main/native/ChipObject/tAI.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_AI_h__ -#define __nFRC_2015_1_0_2_AI_h__ +#ifndef __nFRC_2015_1_0_4_AI_h__ +#define __nFRC_2015_1_0_4_AI_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tAI @@ -140,4 +140,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_AI_h__ +#endif // __nFRC_2015_1_0_4_AI_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tAO.h b/hal/Athena/src/main/native/ChipObject/tAO.h index 5f4ec853a1..621cf34fa3 100644 --- a/hal/Athena/src/main/native/ChipObject/tAO.h +++ b/hal/Athena/src/main/native/ChipObject/tAO.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_AO_h__ -#define __nFRC_2015_1_0_2_AO_h__ +#ifndef __nFRC_2015_1_0_4_AO_h__ +#define __nFRC_2015_1_0_4_AO_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tAO @@ -39,15 +39,6 @@ public: virtual unsigned short readMXP(unsigned char reg_index, tRioStatusCode *status) = 0; - typedef enum - { - kNumValueRegisters = 2, - } tValue_IfaceConstants; - - virtual void writeValue(unsigned char reg_index, unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readValue(unsigned char reg_index, tRioStatusCode *status) = 0; - - private: tAO(const tAO&); void operator=(const tAO&); @@ -56,4 +47,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_AO_h__ +#endif // __nFRC_2015_1_0_4_AO_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tAccel.h b/hal/Athena/src/main/native/ChipObject/tAccel.h index df3c9d2960..cdbc5a9b7e 100644 --- a/hal/Athena/src/main/native/ChipObject/tAccel.h +++ b/hal/Athena/src/main/native/ChipObject/tAccel.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Accel_h__ -#define __nFRC_2015_1_0_2_Accel_h__ +#ifndef __nFRC_2015_1_0_4_Accel_h__ +#define __nFRC_2015_1_0_4_Accel_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tAccel @@ -59,4 +59,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Accel_h__ +#endif // __nFRC_2015_1_0_4_Accel_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tAccumulator.h b/hal/Athena/src/main/native/ChipObject/tAccumulator.h index 804eceafbb..78f176cb1d 100644 --- a/hal/Athena/src/main/native/ChipObject/tAccumulator.h +++ b/hal/Athena/src/main/native/ChipObject/tAccumulator.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Accumulator_h__ -#define __nFRC_2015_1_0_2_Accumulator_h__ +#ifndef __nFRC_2015_1_0_4_Accumulator_h__ +#define __nFRC_2015_1_0_4_Accumulator_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tAccumulator @@ -84,4 +84,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Accumulator_h__ +#endif // __nFRC_2015_1_0_4_Accumulator_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tAlarm.h b/hal/Athena/src/main/native/ChipObject/tAlarm.h index ad1d5ab8cc..e590fc0a79 100644 --- a/hal/Athena/src/main/native/ChipObject/tAlarm.h +++ b/hal/Athena/src/main/native/ChipObject/tAlarm.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Alarm_h__ -#define __nFRC_2015_1_0_2_Alarm_h__ +#ifndef __nFRC_2015_1_0_4_Alarm_h__ +#define __nFRC_2015_1_0_4_Alarm_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tAlarm @@ -54,4 +54,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Alarm_h__ +#endif // __nFRC_2015_1_0_4_Alarm_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tAnalogTrigger.h b/hal/Athena/src/main/native/ChipObject/tAnalogTrigger.h index 84fa939296..cb9efe1705 100644 --- a/hal/Athena/src/main/native/ChipObject/tAnalogTrigger.h +++ b/hal/Athena/src/main/native/ChipObject/tAnalogTrigger.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_AnalogTrigger_h__ -#define __nFRC_2015_1_0_2_AnalogTrigger_h__ +#ifndef __nFRC_2015_1_0_4_AnalogTrigger_h__ +#define __nFRC_2015_1_0_4_AnalogTrigger_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tAnalogTrigger @@ -126,4 +126,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_AnalogTrigger_h__ +#endif // __nFRC_2015_1_0_4_AnalogTrigger_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tBIST.h b/hal/Athena/src/main/native/ChipObject/tBIST.h index bd076009b7..45efb780dc 100644 --- a/hal/Athena/src/main/native/ChipObject/tBIST.h +++ b/hal/Athena/src/main/native/ChipObject/tBIST.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_BIST_h__ -#define __nFRC_2015_1_0_2_BIST_h__ +#ifndef __nFRC_2015_1_0_4_BIST_h__ +#define __nFRC_2015_1_0_4_BIST_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tBIST @@ -87,4 +87,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_BIST_h__ +#endif // __nFRC_2015_1_0_4_BIST_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tCounter.h b/hal/Athena/src/main/native/ChipObject/tCounter.h index 9d79eb22b0..6192f500f1 100644 --- a/hal/Athena/src/main/native/ChipObject/tCounter.h +++ b/hal/Athena/src/main/native/ChipObject/tCounter.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Counter_h__ -#define __nFRC_2015_1_0_2_Counter_h__ +#ifndef __nFRC_2015_1_0_4_Counter_h__ +#define __nFRC_2015_1_0_4_Counter_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tCounter @@ -216,4 +216,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Counter_h__ +#endif // __nFRC_2015_1_0_4_Counter_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tDIO.h b/hal/Athena/src/main/native/ChipObject/tDIO.h index f8ee9e1887..8ba2210cbb 100644 --- a/hal/Athena/src/main/native/ChipObject/tDIO.h +++ b/hal/Athena/src/main/native/ChipObject/tDIO.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_DIO_h__ -#define __nFRC_2015_1_0_2_DIO_h__ +#ifndef __nFRC_2015_1_0_4_DIO_h__ +#define __nFRC_2015_1_0_4_DIO_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tDIO @@ -93,27 +93,6 @@ public: unsigned value : 32; }; } tDI; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned PeriodPower : 6; - unsigned OutputSelect_0 : 5; - unsigned OutputSelect_1 : 5; - unsigned OutputSelect_2 : 5; - unsigned OutputSelect_3 : 5; -#else - unsigned OutputSelect_3 : 5; - unsigned OutputSelect_2 : 5; - unsigned OutputSelect_1 : 5; - unsigned OutputSelect_0 : 5; - unsigned PeriodPower : 6; -#endif - }; - struct{ - unsigned value : 26; - }; - } tPWMConfig; @@ -133,11 +112,20 @@ public: typedef enum { - kNumPWMDutyCycleElements = 4, - } tPWMDutyCycle_IfaceConstants; + kNumPWMDutyCycleAElements = 4, + } tPWMDutyCycleA_IfaceConstants; - virtual void writePWMDutyCycle(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPWMDutyCycle(unsigned char bitfield_index, tRioStatusCode *status) = 0; + virtual void writePWMDutyCycleA(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; + virtual unsigned char readPWMDutyCycleA(unsigned char bitfield_index, tRioStatusCode *status) = 0; + + + typedef enum + { + kNumPWMDutyCycleBElements = 2, + } tPWMDutyCycleB_IfaceConstants; + + virtual void writePWMDutyCycleB(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; + virtual unsigned char readPWMDutyCycleB(unsigned char bitfield_index, tRioStatusCode *status) = 0; typedef enum @@ -172,6 +160,15 @@ public: virtual unsigned short readOutputEnable_MXP(tRioStatusCode *status) = 0; + typedef enum + { + kNumPWMOutputSelectElements = 6, + } tPWMOutputSelect_IfaceConstants; + + virtual void writePWMOutputSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; + virtual unsigned char readPWMOutputSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0; + + typedef enum { } tPulse_IfaceConstants; @@ -232,20 +229,10 @@ public: typedef enum { - } tPWMConfig_IfaceConstants; + } tPWMPeriodPower_IfaceConstants; - virtual void writePWMConfig(tPWMConfig value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_PeriodPower(unsigned char value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_OutputSelect_0(unsigned char value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_OutputSelect_1(unsigned char value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_OutputSelect_2(unsigned char value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_OutputSelect_3(unsigned char value, tRioStatusCode *status) = 0; - virtual tPWMConfig readPWMConfig(tRioStatusCode *status) = 0; - virtual unsigned char readPWMConfig_PeriodPower(tRioStatusCode *status) = 0; - virtual unsigned char readPWMConfig_OutputSelect_0(tRioStatusCode *status) = 0; - virtual unsigned char readPWMConfig_OutputSelect_1(tRioStatusCode *status) = 0; - virtual unsigned char readPWMConfig_OutputSelect_2(tRioStatusCode *status) = 0; - virtual unsigned char readPWMConfig_OutputSelect_3(tRioStatusCode *status) = 0; + virtual void writePWMPeriodPower(unsigned short value, tRioStatusCode *status) = 0; + virtual unsigned short readPWMPeriodPower(tRioStatusCode *status) = 0; @@ -258,4 +245,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_DIO_h__ +#endif // __nFRC_2015_1_0_4_DIO_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tDMA.h b/hal/Athena/src/main/native/ChipObject/tDMA.h index 06e699910e..f99aece645 100644 --- a/hal/Athena/src/main/native/ChipObject/tDMA.h +++ b/hal/Athena/src/main/native/ChipObject/tDMA.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_DMA_h__ -#define __nFRC_2015_1_0_2_DMA_h__ +#ifndef __nFRC_2015_1_0_4_DMA_h__ +#define __nFRC_2015_1_0_4_DMA_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tDMA @@ -185,4 +185,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_DMA_h__ +#endif // __nFRC_2015_1_0_4_DMA_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tEncoder.h b/hal/Athena/src/main/native/ChipObject/tEncoder.h index 8d32017462..7abfc1b926 100644 --- a/hal/Athena/src/main/native/ChipObject/tEncoder.h +++ b/hal/Athena/src/main/native/ChipObject/tEncoder.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Encoder_h__ -#define __nFRC_2015_1_0_2_Encoder_h__ +#ifndef __nFRC_2015_1_0_4_Encoder_h__ +#define __nFRC_2015_1_0_4_Encoder_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tEncoder @@ -196,4 +196,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Encoder_h__ +#endif // __nFRC_2015_1_0_4_Encoder_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tGlobal.h b/hal/Athena/src/main/native/ChipObject/tGlobal.h index 3d516c06c9..03b93b0df5 100644 --- a/hal/Athena/src/main/native/ChipObject/tGlobal.h +++ b/hal/Athena/src/main/native/ChipObject/tGlobal.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Global_h__ -#define __nFRC_2015_1_0_2_Global_h__ +#ifndef __nFRC_2015_1_0_4_Global_h__ +#define __nFRC_2015_1_0_4_Global_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tGlobal @@ -101,4 +101,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Global_h__ +#endif // __nFRC_2015_1_0_4_Global_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tInterrupt.h b/hal/Athena/src/main/native/ChipObject/tInterrupt.h index 7993004e54..a6275b6cf7 100644 --- a/hal/Athena/src/main/native/ChipObject/tInterrupt.h +++ b/hal/Athena/src/main/native/ChipObject/tInterrupt.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Interrupt_h__ -#define __nFRC_2015_1_0_2_Interrupt_h__ +#ifndef __nFRC_2015_1_0_4_Interrupt_h__ +#define __nFRC_2015_1_0_4_Interrupt_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tInterrupt @@ -90,4 +90,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Interrupt_h__ +#endif // __nFRC_2015_1_0_4_Interrupt_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tPWM.h b/hal/Athena/src/main/native/ChipObject/tPWM.h index 5f8f7e220e..c0b2e08cb6 100644 --- a/hal/Athena/src/main/native/ChipObject/tPWM.h +++ b/hal/Athena/src/main/native/ChipObject/tPWM.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_PWM_h__ -#define __nFRC_2015_1_0_2_PWM_h__ +#ifndef __nFRC_2015_1_0_4_PWM_h__ +#define __nFRC_2015_1_0_4_PWM_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tPWM @@ -108,4 +108,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_PWM_h__ +#endif // __nFRC_2015_1_0_4_PWM_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tPower.h b/hal/Athena/src/main/native/ChipObject/tPower.h index b0ede13787..f9fc7a8b8e 100644 --- a/hal/Athena/src/main/native/ChipObject/tPower.h +++ b/hal/Athena/src/main/native/ChipObject/tPower.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Power_h__ -#define __nFRC_2015_1_0_2_Power_h__ +#ifndef __nFRC_2015_1_0_4_Power_h__ +#define __nFRC_2015_1_0_4_Power_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tPower @@ -31,15 +31,15 @@ public: #ifdef __vxworks unsigned User3V3 : 8; unsigned User5V : 8; - signed User6V : 16; + unsigned User6V : 8; #else - signed User6V : 16; + unsigned User6V : 8; unsigned User5V : 8; unsigned User3V3 : 8; #endif }; struct{ - unsigned value : 32; + unsigned value : 24; }; } tStatus; typedef @@ -69,7 +69,7 @@ public: virtual tStatus readStatus(tRioStatusCode *status) = 0; virtual unsigned char readStatus_User3V3(tRioStatusCode *status) = 0; virtual unsigned char readStatus_User5V(tRioStatusCode *status) = 0; - virtual signed short readStatus_User6V(tRioStatusCode *status) = 0; + virtual unsigned char readStatus_User6V(tRioStatusCode *status) = 0; typedef enum @@ -104,4 +104,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Power_h__ +#endif // __nFRC_2015_1_0_4_Power_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tRelay.h b/hal/Athena/src/main/native/ChipObject/tRelay.h index 93db1848dd..3edfb66b04 100644 --- a/hal/Athena/src/main/native/ChipObject/tRelay.h +++ b/hal/Athena/src/main/native/ChipObject/tRelay.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_Relay_h__ -#define __nFRC_2015_1_0_2_Relay_h__ +#ifndef __nFRC_2015_1_0_4_Relay_h__ +#define __nFRC_2015_1_0_4_Relay_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tRelay @@ -65,4 +65,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_Relay_h__ +#endif // __nFRC_2015_1_0_4_Relay_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tSPI.h b/hal/Athena/src/main/native/ChipObject/tSPI.h new file mode 100644 index 0000000000..d8c4e7679e --- /dev/null +++ b/hal/Athena/src/main/native/ChipObject/tSPI.h @@ -0,0 +1,68 @@ +// Copyright (c) National Instruments 2008. All Rights Reserved. +// Do Not Edit... this file is generated! + +#ifndef __nFRC_2015_1_0_4_SPI_h__ +#define __nFRC_2015_1_0_4_SPI_h__ + +#include "tSystemInterface.h" + +namespace nFPGA +{ +namespace nFRC_2015_1_0_4 +{ + +class tSPI +{ +public: + tSPI(){} + virtual ~tSPI(){} + + virtual tSystemInterface* getSystemInterface() = 0; + static tSPI* create(tRioStatusCode *status); + + typedef enum + { + kNumSystems = 1, + } tIfaceConstants; + + typedef + union{ + struct{ +#ifdef __vxworks + unsigned Hdr : 4; + unsigned MXP : 1; +#else + unsigned MXP : 1; + unsigned Hdr : 4; +#endif + }; + struct{ + unsigned value : 5; + }; + } tChipSelectActiveHigh; + + + + typedef enum + { + } tChipSelectActiveHigh_IfaceConstants; + + virtual void writeChipSelectActiveHigh(tChipSelectActiveHigh value, tRioStatusCode *status) = 0; + virtual void writeChipSelectActiveHigh_Hdr(unsigned char value, tRioStatusCode *status) = 0; + virtual void writeChipSelectActiveHigh_MXP(unsigned char value, tRioStatusCode *status) = 0; + virtual tChipSelectActiveHigh readChipSelectActiveHigh(tRioStatusCode *status) = 0; + virtual unsigned char readChipSelectActiveHigh_Hdr(tRioStatusCode *status) = 0; + virtual unsigned char readChipSelectActiveHigh_MXP(tRioStatusCode *status) = 0; + + + + +private: + tSPI(const tSPI&); + void operator=(const tSPI&); +}; + +} +} + +#endif // __nFRC_2015_1_0_4_SPI_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tSysWatchdog.h b/hal/Athena/src/main/native/ChipObject/tSysWatchdog.h index 05bc242533..1cb207d2f7 100644 --- a/hal/Athena/src/main/native/ChipObject/tSysWatchdog.h +++ b/hal/Athena/src/main/native/ChipObject/tSysWatchdog.h @@ -1,14 +1,14 @@ // Copyright (c) National Instruments 2008. All Rights Reserved. // Do Not Edit... this file is generated! -#ifndef __nFRC_2015_1_0_2_SysWatchdog_h__ -#define __nFRC_2015_1_0_2_SysWatchdog_h__ +#ifndef __nFRC_2015_1_0_4_SysWatchdog_h__ +#define __nFRC_2015_1_0_4_SysWatchdog_h__ #include "tSystemInterface.h" namespace nFPGA { -namespace nFRC_2015_1_0_2 +namespace nFRC_2015_1_0_4 { class tSysWatchdog @@ -25,9 +25,39 @@ public: kNumSystems = 1, } tIfaceConstants; + typedef + union{ + struct{ +#ifdef __vxworks + unsigned SystemActive : 1; + unsigned PowerAlive : 1; + unsigned SysDisableCount : 15; + unsigned PowerDisableCount : 15; +#else + unsigned PowerDisableCount : 15; + unsigned SysDisableCount : 15; + unsigned PowerAlive : 1; + unsigned SystemActive : 1; +#endif + }; + struct{ + unsigned value : 32; + }; + } tStatus; + typedef enum + { + } tStatus_IfaceConstants; + + virtual tStatus readStatus(tRioStatusCode *status) = 0; + virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0; + virtual bool readStatus_PowerAlive(tRioStatusCode *status) = 0; + virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0; + virtual unsigned short readStatus_PowerDisableCount(tRioStatusCode *status) = 0; + + typedef enum { } tCommand_IfaceConstants; @@ -68,4 +98,4 @@ private: } } -#endif // __nFRC_2015_1_0_2_SysWatchdog_h__ +#endif // __nFRC_2015_1_0_4_SysWatchdog_h__ diff --git a/hal/Athena/src/main/native/ChipObject/tSystemInterface.h b/hal/Athena/src/main/native/ChipObject/tSystemInterface.h index 46786e8e7d..d5008e1f5a 100644 --- a/hal/Athena/src/main/native/ChipObject/tSystemInterface.h +++ b/hal/Athena/src/main/native/ChipObject/tSystemInterface.h @@ -12,9 +12,9 @@ public: tSystemInterface(){} virtual ~tSystemInterface(){} - virtual const uint16_t getExpectedFPGAVersion()=0; - virtual const uint32_t getExpectedFPGARevision()=0; - virtual const uint32_t * const getExpectedFPGASignature()=0; + virtual uint16_t getExpectedFPGAVersion()=0; + virtual uint32_t getExpectedFPGARevision()=0; + virtual uint32_t * getExpectedFPGASignature()=0; virtual void getHardwareFpgaSignature(uint32_t *guid_ptr, tRioStatusCode *status)=0; virtual uint32_t getLVHandle(tRioStatusCode *status)=0; virtual uint32_t getHandle()=0; diff --git a/hal/Athena/src/main/native/ChipObject/tWatchdog.h b/hal/Athena/src/main/native/ChipObject/tWatchdog.h deleted file mode 100644 index ddbc24cb66..0000000000 --- a/hal/Athena/src/main/native/ChipObject/tWatchdog.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2015_1_0_2_Watchdog_h__ -#define __nFRC_2015_1_0_2_Watchdog_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2015_1_0_2 -{ - -class tWatchdog -{ -public: - tWatchdog(){} - virtual ~tWatchdog(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tWatchdog* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned SystemActive : 1; - unsigned Alive : 1; - unsigned SysDisableCount : 15; - unsigned DisableCount : 15; -#else - unsigned DisableCount : 15; - unsigned SysDisableCount : 15; - unsigned Alive : 1; - unsigned SystemActive : 1; -#endif - }; - struct{ - unsigned value : 32; - }; - } tStatus; - - - - typedef enum - { - } tStatus_IfaceConstants; - - virtual tStatus readStatus(tRioStatusCode *status) = 0; - virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0; - virtual bool readStatus_Alive(tRioStatusCode *status) = 0; - virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0; - virtual unsigned short readStatus_DisableCount(tRioStatusCode *status) = 0; - - - typedef enum - { - } tKill_IfaceConstants; - - virtual void strobeKill(tRioStatusCode *status) = 0; - - - typedef enum - { - } tFeed_IfaceConstants; - - virtual void strobeFeed(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimer_IfaceConstants; - - virtual unsigned int readTimer(tRioStatusCode *status) = 0; - - - typedef enum - { - } tExpiration_IfaceConstants; - - virtual void writeExpiration(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readExpiration(tRioStatusCode *status) = 0; - - - typedef enum - { - } tImmortal_IfaceConstants; - - virtual void writeImmortal(bool value, tRioStatusCode *status) = 0; - virtual bool readImmortal(tRioStatusCode *status) = 0; - - - - -private: - tWatchdog(const tWatchdog&); - void operator=(const tWatchdog&); -}; - -} -} - -#endif // __nFRC_2015_1_0_2_Watchdog_h__ diff --git a/hal/Athena/src/main/native/Digital.cpp b/hal/Athena/src/main/native/Digital.cpp index da7c2e8b7a..7c61cdcb0d 100644 --- a/hal/Athena/src/main/native/Digital.cpp +++ b/hal/Athena/src/main/native/Digital.cpp @@ -78,7 +78,7 @@ void initializeDigital(int32_t *status) { digitalI2CSemaphore = initializeMutexRecursive(); Resource::CreateResourceObject(&DIOChannels, tDIO::kNumSystems * kDigitalPins); - Resource::CreateResourceObject(&DO_PWMGenerators, tDIO::kNumPWMDutyCycleElements); + Resource::CreateResourceObject(&DO_PWMGenerators, tDIO::kNumPWMDutyCycleAElements + tDIO::kNumPWMDutyCycleBElements); digitalSystem = tDIO::create(status); // Relay Setup @@ -273,7 +273,7 @@ void setPWMRateWithModule(uint8_t module, double rate, int32_t *status) { // Currently rounding in the log rate domain... heavy weight toward picking a higher freq. // TODO: Round in the linear rate domain. uint8_t pwmPeriodPower = (uint8_t)(log(1.0 / (pwmSystem->readLoopTiming(status) * 0.25E-6 * rate))/log(2.0) + 0.5); - digitalSystem->writePWMConfig_PeriodPower(pwmPeriodPower, status); + digitalSystem->writePWMPeriodPower(pwmPeriodPower, status); } /** @@ -301,12 +301,13 @@ void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCy if (rawDutyCycle > 255.5) rawDutyCycle = 255.5; { Synchronized sync(digitalPwmSemaphore); - uint8_t pwmPeriodPower = digitalSystem->readPWMConfig_PeriodPower(status); + uint8_t pwmPeriodPower = digitalSystem->readPWMPeriodPower(status); if (pwmPeriodPower < 4) { // The resolution of the duty cycle drops close to the highest frequencies. rawDutyCycle = rawDutyCycle / pow(2.0, 4 - pwmPeriodPower); } - digitalSystem->writePWMDutyCycle(id, (uint8_t)rawDutyCycle, status); + digitalSystem->writePWMDutyCycleA(id, (uint8_t)rawDutyCycle, status); + digitalSystem->writePWMDutyCycleB(id, (uint8_t)rawDutyCycle, status); } } @@ -331,16 +332,22 @@ void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t if (id == ~0ul) return; switch(id) { case 0: - digitalSystem->writePWMConfig_OutputSelect_0(remapDigitalChannel(pin - 1, status), status); + digitalSystem->writePWMOutputSelect(0, remapDigitalChannel(pin - 1, status), status); break; case 1: - digitalSystem->writePWMConfig_OutputSelect_1(remapDigitalChannel(pin - 1, status), status); + digitalSystem->writePWMOutputSelect(1, remapDigitalChannel(pin - 1, status), status); break; case 2: - digitalSystem->writePWMConfig_OutputSelect_2(remapDigitalChannel(pin - 1, status), status); + digitalSystem->writePWMOutputSelect(2, remapDigitalChannel(pin - 1, status), status); break; case 3: - digitalSystem->writePWMConfig_OutputSelect_3(remapDigitalChannel(pin - 1, status), status); + digitalSystem->writePWMOutputSelect(3, remapDigitalChannel(pin - 1, status), status); + break; + case 4: + digitalSystem->writePWMOutputSelect(4, remapDigitalChannel(pin - 1, status), status); + break; + case 5: + digitalSystem->writePWMOutputSelect(5, remapDigitalChannel(pin - 1, status), status); break; } } diff --git a/hal/Athena/src/main/native/HAL.cpp b/hal/Athena/src/main/native/HAL.cpp index 0e9eb600b3..84a96f6dd9 100644 --- a/hal/Athena/src/main/native/HAL.cpp +++ b/hal/Athena/src/main/native/HAL.cpp @@ -6,6 +6,8 @@ #include "ChipObject.h" #include "NetworkCommunication/FRCComm.h" #include "NetworkCommunication/UsageReporting.h" +#include "NetworkCommunication/LoadOut.h" +#include "ChipObject/nInterfaceGlobals.h" // XXX: What to do with solenoids? const uint32_t solenoid_kNumDO7_0Elements = tSolenoid::kNumDO7_0Elements; const uint32_t dio_kNumSystems = tDIO::kNumSystems; @@ -149,7 +151,7 @@ int HALSetStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber, void HALNetworkCommunicationReserve() { - FRC_NetworkCommunication_Reserve(); + nFPGA::nRoboRIO_FPGANamespace::g_currentTargetClass = nLoadOut::kTargetClass_RoboRIO; } void HALNetworkCommunicationObserveUserProgramStarting(void) @@ -179,7 +181,8 @@ void HALNetworkCommunicationObserveUserProgramTest(void) uint32_t HALReport(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char *feature) { - return FRC_NetworkCommunication_nUsageReporting_report( resource, instanceNumber, context, feature); + //return FRC_NetworkCommunication_nUsageReporting_report( resource, instanceNumber, context, feature); + return 0; } diff --git a/hal/Athena/src/main/native/NetworkCommunication/FRCComm.h b/hal/Athena/src/main/native/NetworkCommunication/FRCComm.h index 50a534bf2f..ae248900ee 100644 --- a/hal/Athena/src/main/native/NetworkCommunication/FRCComm.h +++ b/hal/Athena/src/main/native/NetworkCommunication/FRCComm.h @@ -16,7 +16,11 @@ #ifdef SIMULATION #include +#ifdef USE_THRIFT +#define EXPORT_FUNC +#else #define EXPORT_FUNC __declspec(dllexport) __cdecl +#endif #else #if defined(__vxworks) #include @@ -145,12 +149,14 @@ struct FRCCommonControlData{ #define kFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24 #define kFRC_NetworkCommunication_DynamicType_Kinect_Custom 25 +#ifdef __cplusplus extern "C" { +#endif #ifndef SIMULATION void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision); #endif - int EXPORT_FUNC getCommonControlData(FRCCommonControlData *data, int wait_ms); - int EXPORT_FUNC getRecentCommonControlData(FRCCommonControlData *commonData, int wait_ms); + int EXPORT_FUNC getCommonControlData(struct FRCCommonControlData *data, int wait_ms); + int EXPORT_FUNC getRecentCommonControlData(struct FRCCommonControlData *commonData, int wait_ms); int EXPORT_FUNC getRecentStatusData(uint8_t *batteryInt, uint8_t *batteryDec, uint8_t *dsDigitalOut, int wait_ms); int EXPORT_FUNC getDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms); int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber, @@ -162,7 +168,7 @@ extern "C" { int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms); int EXPORT_FUNC setUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms); int EXPORT_FUNC overrideIOConfig(const char *ioConfig, int wait_ms); - + #ifdef SIMULATION void EXPORT_FUNC setNewDataSem(HANDLE); #else @@ -188,8 +194,8 @@ extern "C" { void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void); void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void); void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void); - void EXPORT_FUNC FRC_NetworkCommunication_Reserve(); - -}; +#ifdef __cplusplus +} +#endif #endif diff --git a/hal/Athena/src/main/native/NetworkCommunication/JaguarCANDriver.h b/hal/Athena/src/main/native/NetworkCommunication/JaguarCANDriver.h index b466f6d1b6..67797e6063 100644 --- a/hal/Athena/src/main/native/NetworkCommunication/JaguarCANDriver.h +++ b/hal/Athena/src/main/native/NetworkCommunication/JaguarCANDriver.h @@ -14,6 +14,25 @@ #include #include #endif +#ifdef USE_THRIFT +#include "NetCommRPCComm.h" +#include +#endif +namespace nJaguarCANDriver +{ + void sendMessage_wrapper(uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t *status); + void receiveMessage_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, uint32_t timeoutMs, int32_t *status); + int32_t receiveMessageStart_wrapper(uint32_t messageID, uint32_t occurRefNum, uint32_t timeoutMs, int32_t *status); +#if defined (__vxworks) + int32_t receiveMessageStart_sem_wrapper(uint32_t messageID, uint32_t semaphoreID, uint32_t timeoutMs, int32_t *status); +#else + int32_t receiveMessageStart_mutex_wrapper(uint32_t messageID, pthread_mutex_t *mutex, uint32_t timeoutMs, int32_t *status); +#endif + void receiveMessageComplete_wrapper(uint32_t *messageID, uint8_t *data, uint8_t *dataSize, int32_t *status); +#ifdef USE_THRIFT + void checkEvent_CAN(std::vector< CANEvent >& events); +#endif +} #ifdef __cplusplus extern "C" diff --git a/hal/Athena/src/main/native/Utilities.cpp b/hal/Athena/src/main/native/Utilities.cpp index e79259ebc9..9121948433 100644 --- a/hal/Athena/src/main/native/Utilities.cpp +++ b/hal/Athena/src/main/native/Utilities.cpp @@ -23,7 +23,7 @@ void delayMillis(double ms) { void delaySeconds(double s) { struct timespec test, remaining; - test.tv_sec = 0; - test.tv_nsec = s * 1000000000.0; + test.tv_sec = (int) s; + test.tv_nsec = (s - (int)s) * 1000000000.0; nanosleep(&test, &remaining); } diff --git a/hal/Athena/src/main/native/Watchdog.cpp b/hal/Athena/src/main/native/Watchdog.cpp deleted file mode 100644 index 59e2041ab3..0000000000 --- a/hal/Athena/src/main/native/Watchdog.cpp +++ /dev/null @@ -1,140 +0,0 @@ - -#include "HAL/Watchdog.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" - -typedef tWatchdog Watchdog; -const double kDefaultWatchdogExpiration = 0.5; - -void* initializeWatchdog(int32_t *status) { - Watchdog* watchdog = tWatchdog::create(status); - setWatchdogExpiration(watchdog, kDefaultWatchdogExpiration, status); - setWatchdogEnabled(watchdog, true, status); - return watchdog; -} - -void cleanWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - setWatchdogEnabled(watchdog, false, status); - delete watchdog; -} - -/** - * Throw the dog a bone. - * - * When everything is going well, you feed your dog when you get home. - * Let's hope you don't drive your car off a bridge on the way home... - * Your dog won't get fed and he will starve to death. - * - * By the way, it's not cool to ask the neighbor (some random task) to - * feed your dog for you. He's your responsibility! - * - * @returns Returns the previous state of the watchdog before feeding it. - */ -bool feedWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool previous = getWatchdogEnabled(watchdog_pointer, status); - watchdog->strobeFeed(status); - return previous; -} - -/** - * Put the watchdog out of its misery. - * - * Don't wait for your dying robot to starve when there is a problem. - * Kill it quickly, cleanly, and humanely. - */ -void killWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->strobeKill(status); -} - -/** - * Read how long it has been since the watchdog was last fed. - * - * @return The number of seconds since last meal. - */ -double getWatchdogLastFed(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - uint32_t timer = watchdog->readTimer(status); - return timer / (kSystemClockTicksPerMicrosecond * 1e6); -} - -/** - * Read what the current expiration is. - * - * @return The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -double getWatchdogExpiration(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - uint32_t expiration = watchdog->readExpiration(status); - return expiration / (kSystemClockTicksPerMicrosecond * 1e6); -} - -/** - * Configure how many seconds your watchdog can be neglected before it starves to death. - * - * @param expiration The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -void setWatchdogExpiration(void* watchdog_pointer, double expiration, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->writeExpiration((uint32_t)(expiration * (kSystemClockTicksPerMicrosecond * 1e6)), status); -} - -/** - * Find out if the watchdog is currently enabled or disabled (mortal or immortal). - * - * @return Enabled or disabled. - */ -bool getWatchdogEnabled(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool enabled = !watchdog->readImmortal(status); - return enabled; -} - -/** - * Enable or disable the watchdog timer. - * - * When enabled, you must keep feeding the watchdog timer to - * keep the watchdog active, and hence the dangerous parts - * (motor outputs, etc.) can keep functioning. - * When disabled, the watchdog is immortal and will remain active - * even without being fed. It will also ignore any kill commands - * while disabled. - * - * @param enabled Enable or disable the watchdog. - */ -void setWatchdogEnabled(void* watchdog_pointer, bool enabled, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->writeImmortal(!enabled, status); -} - -/** - * Check in on the watchdog and make sure he's still kicking. - * - * This indicates that your watchdog is allowing the system to operate. - * It is still possible that the network communications is not allowing the - * system to run, but you can check this to make sure it's not your fault. - * Check IsSystemActive() for overall system status. - * - * If the watchdog is disabled, then your watchdog is immortal. - * - * @return Is the watchdog still alive? - */ -bool isWatchdogAlive(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool alive = watchdog->readStatus_Alive(status); - return alive; -} - -/** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ -bool isWatchdogSystemActive(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool alive = watchdog->readStatus_SystemActive(status); - return alive; -} diff --git a/hal/Athena/src/main/native/i2c-lib.h b/hal/Athena/src/main/native/i2clib/i2c-lib.h similarity index 100% rename from hal/Athena/src/main/native/i2c-lib.h rename to hal/Athena/src/main/native/i2clib/i2c-lib.h diff --git a/hal/Athena/src/main/native/i2clib/i2clib/environs.h b/hal/Athena/src/main/native/i2clib/i2clib/environs.h new file mode 100644 index 0000000000..518a991713 --- /dev/null +++ b/hal/Athena/src/main/native/i2clib/i2clib/environs.h @@ -0,0 +1,66 @@ +/*! + \file environs.h + \brief Defines export symbols and namespace aliases +*/ +/* + Copyright (c) 2014, + National Instruments Corporation. + All rights reserved. + + File: $Id: //lvaddon/FIRST/FRC/trunk/2015/tools/frcrti/export/1.0/1.0.0a5/includes/wpilib/i2clib/i2clib/environs.h#1 $ + Author: nipg.pl + Originated: Mon Feb 10 10:39:42 2014 +*/ + +#ifndef ___i2clib_environs_h___ +#define ___i2clib_environs_h___ + +#include + +/* + * kI2CLIBExportSymbols directs the build to export symbols modified by + * the kI2CLIBExport keyword. kI2CLIBNoExportSymbols directs the build to not + * import or export symbols modified by the kI2CLIBExport keyword. If + * neither of these are defined, the symbols modified by kI2CLIBExport are + * imported. These should be defined only when building the component, + * so clients do not need to trouble themselves with it. + */ +#if defined(kI2CLIBExportSymbols) + #define kI2CLIBExport kNIExport + #define kI2CLIBExportPre kNIExportPre + #define kI2CLIBExportPost kNIExportPost + #define kI2CLIBExportInline kNIExportInline + #define kI2CLIBExportData kNIExportData +#elif defined(kI2CLIBNoExportSymbols) + #define kI2CLIBExport + #define kI2CLIBExportPre + #define kI2CLIBExportPost + #define kI2CLIBExportInline + #define kI2CLIBExportData +#else + #define kI2CLIBExport kNIImport + #define kI2CLIBExportPre kNIImportPre + #define kI2CLIBExportPost kNIImportPost + #define kI2CLIBExportInline kNIImportInline + #define kI2CLIBExportData kNIImportData +#endif + +// namespace declarations for aliasing ... + +#ifdef __cplusplus + + +/*! + \namespace nI2CLIB_1_0 + \brief i2c user-mode library Release 1.0 +*/ +namespace nI2CLIB_1_0 +{ + // current versioned namespace aliases used by this package + +} + +#endif // __cplusplus + +#endif // ___i2clib_environs_h___ + diff --git a/hal/Athena/src/main/native/spi-lib.h b/hal/Athena/src/main/native/spilib/spi-lib.h similarity index 100% rename from hal/Athena/src/main/native/spi-lib.h rename to hal/Athena/src/main/native/spilib/spi-lib.h diff --git a/hal/AthenaJava/pom.xml b/hal/AthenaJava/pom.xml deleted file mode 100644 index df57994d20..0000000000 --- a/hal/AthenaJava/pom.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.hal - libHALAthenaJava - so - - - edu.wpi.first.wpilib.templates.athena - shared-library - 0.1.0-SNAPSHOT - - - - - com.nativelibs4java - jnaerator-runtime - 0.12-SNAPSHOT - compile - - - edu.wpi.first.wpilib.hal - include - 0.1.0-SNAPSHOT - inczip - - - com.ni.first.libraries - libFRC_NetworkCommunication - 0.1.0-SNAPSHOT - so - - - - - - sonatype - Sonatype OSS Snapshots Repository - http://oss.sonatype.org/content/groups/public - - - - nativelibs4java-repo - http://nativelibs4java.sourceforge.net/maven - - - - - - sonatype - Sonatype OSS Snapshots Repository - http://oss.sonatype.org/content/groups/public - - - - nativelibs4java-repo - http://nativelibs4java.sourceforge.net/maven - - - - - - - org.codehaus.mojo - native-maven-plugin - - - - ../Athena/src/main/native - - **/*.cpp - - - - - - - com.nativelibs4java - maven-jnaerator-plugin - 0.12-SNAPSHOT - true - - - process-classes - - generate - - - - - - - diff --git a/hal/AthenaJava/src/main/jnaerator/config.jnaerator b/hal/AthenaJava/src/main/jnaerator/config.jnaerator deleted file mode 100644 index fcc6546955..0000000000 --- a/hal/AthenaJava/src/main/jnaerator/config.jnaerator +++ /dev/null @@ -1,15 +0,0 @@ --dontCastConstants --runtime JNAerator --direct -// -reification --M__java=true - --package edu.wpi.first.wpilibj.hal -// -entryClass HAL - --library HAL --Itarget/native/include/ - -target/native/include/HAL/HAL.h -// include/HAL/Errors.h - diff --git a/hal/AthenaXX/pom.xml b/hal/AthenaXX/pom.xml deleted file mode 100644 index 7b07e2c9d8..0000000000 --- a/hal/AthenaXX/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.hal - libHALAthenaXX - a - - - edu.wpi.first.wpilib.templates.athena - static-library - 0.1.0-SNAPSHOT - ../../maven-utilities/Athena/static-library/pom.xml - - - - - edu.wpi.first.wpilib.hal - include - 0.1.0-SNAPSHOT - inczip - - - - - - - org.codehaus.mojo - native-maven-plugin - - - - src/main/native - - **/*.cpp - - - - - - - - diff --git a/hal/AthenaXX/src/main/native/Analog.cpp b/hal/AthenaXX/src/main/native/Analog.cpp deleted file mode 100644 index 8c752b5efc..0000000000 --- a/hal/AthenaXX/src/main/native/Analog.cpp +++ /dev/null @@ -1,696 +0,0 @@ - -#include "HAL/Analog.h" - -#include "Port.h" -#include "HAL/Errors.h" -#include "HAL/Semaphore.h" -#include "ChipObject.h" -#include "HAL/cpp/Synchronized.h" -#include "HAL/cpp/Resource.h" -#include "NetworkCommunication/AICalibration.h" -#include "NetworkCommunication/LoadOut.h" - -#include // TODO: remove printf for debugging - -static const long kTimebase = 40000000; ///< 40 MHz clock -static const long kDefaultOversampleBits = 0; -static const long kDefaultAverageBits = 7; -static const float kDefaultSampleRate = 50000.0; -static const uint32_t kAnalogPins = 8; - -static const uint8_t kAccumulatorModuleNumber = 1; -static const uint32_t kAccumulatorNumChannels = 2; -static const uint32_t kAccumulatorChannels[] = {1, 2}; - -struct analog_port_t { - Port port; - tAI *module; - tAccumulator *accumulator; -}; -typedef struct analog_port_t AnalogPort; - -bool analogSampleRateSet[2] = {false, false}; -MUTEX_ID analogRegisterWindowSemaphore = NULL; -tAI* analogModules[2] = {NULL, NULL}; -uint32_t analogNumChannelsToActivate[2] = {0, 0}; - -// Utility methods defined below. -uint32_t getAnalogNumActiveChannels(uint8_t module, int32_t *status); -uint32_t getAnalogNumChannelsToActivate(uint8_t module, int32_t *status); -void setAnalogNumChannelsToActivate(uint8_t module, uint32_t channels); - -bool analogModulesInitialized = false; - -/** - * Initialize the analog modules. - */ -void initializeAnalog(int32_t *status) { - if (analogModulesInitialized) return; - // Needs to be global since the protected resource spans both module singletons. - analogRegisterWindowSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - for (unsigned int i = 0; i < (sizeof(analogModules)/sizeof(analogModules[0])); i++) { - analogModules[i] = tAI::create(i, status); - setAnalogNumChannelsToActivate(i + 1, kAnalogPins); - setAnalogSampleRateWithModule(i + 1, kDefaultSampleRate, status); - } - analogModulesInitialized = true; -} - -/** - * Initialize the analog port using the given port object. - */ -void* initializeAnalogPort(void* port_pointer, int32_t *status) { - initializeAnalog(status); - Port* port = (Port*) port_pointer; - - // Initialize port structure - AnalogPort* analog_port = new AnalogPort(); - analog_port->port = *port; - analog_port->module = analogModules[analog_port->port.module-1]; - if (isAccumulatorChannel(analog_port, status)) { - analog_port->accumulator = tAccumulator::create(port->pin - 1, status); - } else analog_port->accumulator = NULL; - - // Set default configuration - analog_port->module->writeScanList(port->pin - 1, port->pin - 1, status); - setAnalogAverageBits(analog_port, kDefaultAverageBits, status); - setAnalogOversampleBits(analog_port, kDefaultOversampleBits, status); - return analog_port; -} - - -/** - * Check that the analog module number is valid. - * - * @return Analog module is valid and present - */ -bool checkAnalogModule(uint8_t module) { - if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Analog, module - 1)) - return true; - return false; -} - -/** - * Check that the analog channel number is value. - * Verify that the analog channel number is one of the legal channel numbers. Channel numbers - * are 1-based. - * - * @return Analog channel is valid - */ -bool checkAnalogChannel(uint32_t pin) { - if (pin > 0 && pin <= kAnalogPins) - return true; - return false; -} - -/** - * Set the sample rate on module 0. - * - * This is a global setting for the module and effects all channels. - * - * @param samplesPerSecond The number of samples per channel per second. - */ -void setAnalogSampleRate(double samplesPerSecond, int32_t *status) { - setAnalogSampleRateWithModule(1, samplesPerSecond, status); -} - -/** - * Get the current sample rate on module 0. - * - * This assumes one entry in the scan list. - * This is a global setting for the module and effects all channels. - * - * @return Sample rate. - */ -float getAnalogSampleRate(int32_t *status) { - return getAnalogSampleRateWithModule(1, status); -} - -/** - * Set the sample rate on the module. - * - * This is a global setting for the module and effects all channels. - * - * @param module The module to use - * @param samplesPerSecond The number of samples per channel per second. - */ -void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status) { - // TODO: This will change when variable size scan lists are implemented. - // TODO: Need float comparison with epsilon. - //wpi_assert(!sampleRateSet || GetSampleRate() == samplesPerSecond); - analogSampleRateSet[module-1] = true; - - // Compute the convert rate - uint32_t ticksPerSample = (uint32_t)((float)kTimebase / samplesPerSecond); - uint32_t ticksPerConversion = ticksPerSample / getAnalogNumChannelsToActivate(module, status); - // ticksPerConversion must be at least 80 - if (ticksPerConversion < 80) { - if ((*status) >= 0) *status = SAMPLE_RATE_TOO_HIGH; - ticksPerConversion = 80; - } - - // Atomically set the scan size and the convert rate so that the sample rate is constant - tAI::tConfig config; - config.ScanSize = getAnalogNumChannelsToActivate(module, status); - config.ConvertRate = ticksPerConversion; - analogModules[module-1]->writeConfig(config, status); - - // Indicate that the scan size has been commited to hardware. - setAnalogNumChannelsToActivate(module, 0); -} - -/** - * Get the current sample rate on the module. - * - * This assumes one entry in the scan list. - * This is a global setting for the module and effects all channels. - * - * @param module The module to use - * @return Sample rate. - */ -float getAnalogSampleRateWithModule(uint8_t module, int32_t *status) { - uint32_t ticksPerConversion = analogModules[module-1]->readLoopTiming(status); - uint32_t ticksPerSample = ticksPerConversion * getAnalogNumActiveChannels(module, status); - return (float)kTimebase / (float)ticksPerSample; -} - - -/** - * Set the number of averaging bits. - * - * This sets the number of averaging bits. The actual number of averaged samples is 2**bits. - * Use averaging to improve the stability of your measurement at the expense of sampling rate. - * The averaging is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to configure. - * @param bits Number of bits to average. - */ -void setAnalogAverageBits(void* analog_port_pointer, uint32_t bits, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - port->module->writeAverageBits(port->port.pin - 1, bits, status); -} - -/** - * Get the number of averaging bits. - * - * This gets the number of averaging bits from the FPGA. The actual number of averaged samples is 2**bits. - * The averaging is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Bits to average. - */ -uint32_t getAnalogAverageBits(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - uint32_t result = port->module->readAverageBits(port->port.pin - 1, status); - return result; -} - -/** - * Set the number of oversample bits. - * - * This sets the number of oversample bits. The actual number of oversampled values is 2**bits. - * Use oversampling to improve the resolution of your measurements at the expense of sampling rate. - * The oversampling is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @param bits Number of bits to oversample. - */ -void setAnalogOversampleBits(void* analog_port_pointer, uint32_t bits, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - port->module->writeOversampleBits(port->port.pin - 1, bits, status); -} - - -/** - * Get the number of oversample bits. - * - * This gets the number of oversample bits from the FPGA. The actual number of oversampled values is - * 2**bits. The oversampling is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Bits to oversample. - */ -uint32_t getAnalogOversampleBits(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - uint32_t result = port->module->readOversampleBits(port->port.pin - 1, status); - return result; -} - -/** - * Get a sample straight from the channel on this module. - * - * The sample is a 12-bit value representing the -10V to 10V range of the A/D converter in the module. - * The units are in A/D converter codes. Use GetVoltage() to get the analog value in calibrated units. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A sample straight from the channel on this module. - */ -int16_t getAnalogValue(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - int16_t value; - checkAnalogChannel(port->port.pin); - - tAI::tReadSelect readSelect; - readSelect.Channel = port->port.pin - 1; - readSelect.Module = port->port.module - 1; - readSelect.Averaged = false; - - { - Synchronized sync(analogRegisterWindowSemaphore); - port->module->writeReadSelect(readSelect, status); - port->module->strobeLatchOutput(status); - value = (int16_t) port->module->readOutput(status); - } - - return value; -} - -/** - * Get a sample from the output of the oversample and average engine for the channel. - * - * The sample is 12-bit + the value configured in SetOversampleBits(). - * The value configured in SetAverageBits() will cause this value to be averaged 2**bits number of samples. - * This is not a sliding window. The sample will not change until 2**(OversamplBits + AverageBits) samples - * have been acquired from the module on this channel. - * Use GetAverageVoltage() to get the analog value in calibrated units. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A sample from the oversample and average engine for the channel. - */ -int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - int16_t value; - checkAnalogChannel(port->port.pin); - - tAI::tReadSelect readSelect; - readSelect.Channel = port->port.pin - 1; - readSelect.Module = port->port.module - 1; - readSelect.Averaged = true; - - { - Synchronized sync(analogRegisterWindowSemaphore); - port->module->writeReadSelect(readSelect, status); - port->module->strobeLatchOutput(status); - value = (int16_t) port->module->readOutput(status); - } - - return value; -} - -/** - * Get a scaled sample straight from the channel on this module. - * - * The value is scaled to units of Volts using the calibrated scaling data from GetLSBWeight() and GetOffset(). - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A scaled sample straight from the channel on this module. - */ -float getAnalogVoltage(void* analog_port_pointer, int32_t *status) { - int16_t value = getAnalogValue(analog_port_pointer, status); - uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status); - int32_t offset = getAnalogOffset(analog_port_pointer, status); - float voltage = LSBWeight * 1.0e-9 * value - offset * 1.0e-9; - return voltage; -} - -/** - * Get a scaled sample from the output of the oversample and average engine for the channel. - * - * The value is scaled to units of Volts using the calibrated scaling data from GetLSBWeight() and GetOffset(). - * Using oversampling will cause this value to be higher resolution, but it will update more slowly. - * Using averaging will cause this value to be more stable, but it will update more slowly. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A scaled sample from the output of the oversample and average engine for the channel. - */ -float getAnalogAverageVoltage(void* analog_port_pointer, int32_t *status) { - int32_t value = getAnalogAverageValue(analog_port_pointer, status); - uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status); - int32_t offset = getAnalogOffset(analog_port_pointer, status); - uint32_t oversampleBits = getAnalogOversampleBits(analog_port_pointer, status); - float voltage = ((LSBWeight * 1.0e-9 * value) / (float)(1 << oversampleBits)) - offset * 1.0e-9; - return voltage; -} - -/** - * Convert a voltage to a raw value for a specified channel. - * - * This process depends on the calibration of each channel, so the channel - * must be specified. - * - * @todo This assumes raw values. Oversampling not supported as is. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @param voltage The voltage to convert. - * @return The raw value for the channel. - */ -int32_t getAnalogVoltsToValue(void* analog_port_pointer, double voltage, int32_t *status) { - if (voltage > 10.0) { - voltage = 10.0; - *status = VOLTAGE_OUT_OF_RANGE; - } - if (voltage < -10.0) { - voltage = -10.0; - *status = VOLTAGE_OUT_OF_RANGE; - } - uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status); - int32_t offset = getAnalogOffset(analog_port_pointer, status); - int32_t value = (int32_t) ((voltage + offset * 1.0e-9) / (LSBWeight * 1.0e-9)); - return value; -} - -/** - * Get the factory scaling least significant bit weight constant. - * The least significant bit weight constant for the channel that was calibrated in - * manufacturing and stored in an eeprom in the module. - * - * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9) - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Least significant bit weight. - */ -uint32_t getAnalogLSBWeight(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - uint32_t lsbWeight = FRC_NetworkCommunication_nAICalibration_getLSBWeight(port->module->getSystemIndex(), - port->port.pin - 1, status); - return lsbWeight; -} - -/** - * Get the factory scaling offset constant. - * The offset constant for the channel that was calibrated in manufacturing and stored - * in an eeprom in the module. - * - * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9) - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Offset constant. - */ -int32_t getAnalogOffset(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - int32_t offset = FRC_NetworkCommunication_nAICalibration_getOffset(port->module->getSystemIndex(), - port->port.pin - 1, status); - return offset; -} - - -/** - * Return the number of channels on the module in use. - * - * @return Active channels. - */ -uint32_t getAnalogNumActiveChannels(uint8_t module, int32_t *status) { - uint32_t scanSize = analogModules[module-1]->readConfig_ScanSize(status); - if (scanSize == 0) - return 8; - return scanSize; -} - -/** - * Get the number of active channels. - * - * This is an internal function to allow the atomic update of both the - * number of active channels and the sample rate. - * - * When the number of channels changes, use the new value. Otherwise, - * return the curent value. - * - * @return Value to write to the active channels field. - */ -uint32_t getAnalogNumChannelsToActivate(uint8_t module, int32_t *status) { - if(analogNumChannelsToActivate[module-1] == 0) return getAnalogNumActiveChannels(module, status); - return analogNumChannelsToActivate[module-1]; -} - -/** - * Set the number of active channels. - * - * Store the number of active channels to set. Don't actually commit to hardware - * until SetSampleRate(). - * - * @param channels Number of active channels. - */ -void setAnalogNumChannelsToActivate(uint8_t module, uint32_t channels) { - analogNumChannelsToActivate[module-1] = channels; -} - -//// Accumulator Stuff - -/** - * Is the channel attached to an accumulator. - * - * @return The analog channel is attached to an accumulator. - */ -bool isAccumulatorChannel(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if(port->port.module != kAccumulatorModuleNumber) return false; - for (uint32_t i=0; i < kAccumulatorNumChannels; i++) { - if (port->port.pin == kAccumulatorChannels[i]) return true; - } - return false; -} - -/** - * Initialize the accumulator. - */ -void initAccumulator(void* analog_port_pointer, int32_t *status) { - setAccumulatorCenter(analog_port_pointer, 0, status); - resetAccumulator(analog_port_pointer, status); -} - -/** - * Resets the accumulator to the initial value. - */ -void resetAccumulator(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - port->accumulator->strobeReset(status); -} - -/** - * Set the center value of the accumulator. - * - * The center value is subtracted from each A/D value before it is added to the accumulator. This - * is used for the center value of devices like gyros and accelerometers to make integration work - * and to take the device offset into account when integrating. - * - * This center value is based on the output of the oversampled and averaged source from channel 1. - * Because of this, any non-zero oversample bits will affect the size of the value for this field. - */ -void setAccumulatorCenter(void* analog_port_pointer, int32_t center, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - port->accumulator->writeCenter(center, status); -} - -/** - * Set the accumulator's deadband. - */ -void setAccumulatorDeadband(void* analog_port_pointer, int32_t deadband, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - port->accumulator->writeDeadband(deadband, status); -} - -/** - * Read the accumulated value. - * - * Read the value that has been accumulating on channel 1. - * The accumulator is attached after the oversample and average engine. - * - * @return The 64-bit value accumulated since the last Reset(). - */ -int64_t getAccumulatorValue(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return 0; - } - int64_t value = port->accumulator->readOutput_Value(status); - return value; -} - -/** - * Read the number of accumulated values. - * - * Read the count of the accumulated values since the accumulator was last Reset(). - * - * @return The number of times samples from the channel were accumulated. - */ -uint32_t getAccumulatorCount(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return 0; - } - return port->accumulator->readOutput_Count(status); -} - -/** - * Read the accumulated value and the number of accumulated values atomically. - * - * This function reads the value and count from the FPGA atomically. - * This can be used for averaging. - * - * @param value Pointer to the 64-bit accumulated output. - * @param count Pointer to the number of accumulation cycles. - */ -void getAccumulatorOutput(void* analog_port_pointer, int64_t *value, uint32_t *count, int32_t *status) { -// printf("[HAL] getAccumulatorOutput()\n"); - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - if (value == NULL || count == NULL) { - *status = NULL_PARAMETER; - return; - } - -// printf("[HAL]\t Getting output...\n"); - tAccumulator::tOutput output = port->accumulator->readOutput(status); - -// printf("[HAL]\t Status: %d, Value: %lld, Count: %d.\n", *status, output.Value, output.Count); -// printf("[HAL]\t value: %d, value2: %d, value3: %d.\n", output.value, output.value2, output.value3); -// printf("[HAL]\t Value: %lld, Count: %d.\n", port->accumulator->readOutput_Value(status), port->accumulator->readOutput_Count(status)); - *value = output.Value; - *count = output.Count; -} - - -struct trigger_t { - tAnalogTrigger* trigger; - AnalogPort* port; - uint32_t index; -}; -typedef struct trigger_t AnalogTrigger; - -static Resource *triggers = NULL; - -void* initializeAnalogTrigger(void* port_pointer, uint32_t *index, int32_t *status) { - Port* port = (Port*) port_pointer; - Resource::CreateResourceObject(&triggers, tAnalogTrigger::kNumSystems); - - AnalogTrigger* trigger = new AnalogTrigger(); - trigger->port = (AnalogPort*) initializeAnalogPort(port, status); - trigger->index = triggers->Allocate("Analog Trigger"); - *index = trigger->index; - // TODO: if (index == ~0ul) { CloneError(triggers); return; } - - trigger->trigger = tAnalogTrigger::create(trigger->index, status); - trigger->trigger->writeSourceSelect_Channel(port->pin - 1, status); - trigger->trigger->writeSourceSelect_Module(port->module - 1, status); - - return trigger; -} - -void cleanAnalogTrigger(void* analog_trigger_pointer, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - triggers->Free(trigger->index); - delete trigger->trigger; - delete trigger; -} - -void setAnalogTriggerLimitsRaw(void* analog_trigger_pointer, int32_t lower, int32_t upper, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (lower > upper) { - *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR; - } - trigger->trigger->writeLowerLimit(lower, status); - trigger->trigger->writeUpperLimit(upper, status); -} - -/** - * Set the upper and lower limits of the analog trigger. - * The limits are given as floating point voltage values. - */ -void setAnalogTriggerLimitsVoltage(void* analog_trigger_pointer, double lower, double upper, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (lower > upper) { - *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR; - } - // TODO: This depends on the averaged setting. Only raw values will work as is. - trigger->trigger->writeLowerLimit(getAnalogVoltsToValue(trigger->port, lower, status), status); - trigger->trigger->writeUpperLimit(getAnalogVoltsToValue(trigger->port, upper, status), status); -} - -/** - * Configure the analog trigger to use the averaged vs. raw values. - * If the value is true, then the averaged value is selected for the analog trigger, otherwise - * the immediate value is used. - */ -void setAnalogTriggerAveraged(void* analog_trigger_pointer, bool useAveragedValue, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (trigger->trigger->readSourceSelect_Filter(status) != 0) { - *status = INCOMPATIBLE_STATE; - // TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not support average and filtering at the same time."); - } - trigger->trigger->writeSourceSelect_Averaged(useAveragedValue, status); -} - -/** - * Configure the analog trigger to use a filtered value. - * The analog trigger will operate with a 3 point average rejection filter. This is designed to - * help with 360 degree pot applications for the period where the pot crosses through zero. - */ -void setAnalogTriggerFiltered(void* analog_trigger_pointer, bool useFilteredValue, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (trigger->trigger->readSourceSelect_Averaged(status) != 0) { - *status = INCOMPATIBLE_STATE; - // TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not support average and filtering at the same time."); - } - trigger->trigger->writeSourceSelect_Filter(useFilteredValue, status); -} - -/** - * Return the InWindow output of the analog trigger. - * True if the analog input is between the upper and lower limits. - * @return The InWindow output of the analog trigger. - */ -bool getAnalogTriggerInWindow(void* analog_trigger_pointer, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - return trigger->trigger->readOutput_InHysteresis(trigger->index, status) != 0; -} - -/** - * Return the TriggerState output of the analog trigger. - * True if above upper limit. - * False if below lower limit. - * If in Hysteresis, maintain previous state. - * @return The TriggerState output of the analog trigger. - */ -bool getAnalogTriggerTriggerState(void* analog_trigger_pointer, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - return trigger->trigger->readOutput_OverLimit(trigger->index, status) != 0; -} - -/** - * Get the state of the analog trigger output. - * @return The state of the analog trigger output. - */ -bool getAnalogTriggerOutput(void* analog_trigger_pointer, AnalogTriggerType type, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - bool result = false; - switch(type) { - case kInWindow: - result = trigger->trigger->readOutput_InHysteresis(trigger->index, status); - break; // XXX: Backport - case kState: - result = trigger->trigger->readOutput_OverLimit(trigger->index, status); - break; // XXX: Backport - case kRisingPulse: - case kFallingPulse: - *status = ANALOG_TRIGGER_PULSE_OUTPUT_ERROR; - return false; - } - return result; -} diff --git a/hal/AthenaXX/src/main/native/ChipObject.h b/hal/AthenaXX/src/main/native/ChipObject.h deleted file mode 100644 index a1ab3da685..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject.h +++ /dev/null @@ -1,32 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#ifndef __ChipObject_h__ -#define __ChipObject_h__ - -#include -#include "ChipObject/NiRio.h" - -#include "ChipObject/tAccumulator.h" -#include "ChipObject/tAI.h" -#include "ChipObject/tAlarm.h" -#include "ChipObject/tAnalogTrigger.h" -#include "ChipObject/tCounter.h" -#include "ChipObject/tDIO.h" -#include "ChipObject/tDMA.h" -//#include "ChipObject/tDMAManager.h" -#include "ChipObject/tEncoder.h" -#include "ChipObject/tGlobal.h" -#include "ChipObject/tInterrupt.h" -#include "ChipObject/tInterruptManager.h" -#include "ChipObject/tSolenoid.h" -#include "ChipObject/tSPI.h" -#include "ChipObject/tWatchdog.h" - -using namespace nFPGA; -using namespace nFRC_2012_1_6_4; - -#endif diff --git a/hal/AthenaXX/src/main/native/ChipObject/NiFpga.h b/hal/AthenaXX/src/main/native/ChipObject/NiFpga.h deleted file mode 100644 index 0df6bfbb73..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/NiFpga.h +++ /dev/null @@ -1,2312 +0,0 @@ -/* - * FPGA Interface C API 2.0 header file. - * - * Copyright (c) 2011, - * National Instruments Corporation. - * All rights reserved. - */ - -#ifndef __NiFpga_h__ -#define __NiFpga_h__ - -/* - * Determine platform details. - */ -#if defined(_M_IX86) \ - || defined(_M_X64) \ - || defined(i386) \ - || defined(__i386__) \ - || defined(__amd64__) \ - || defined(__amd64) \ - || defined(__x86_64__) \ - || defined(__x86_64) \ - || defined(__i386) \ - || defined(_X86_) \ - || defined(__THW_INTEL__) \ - || defined(__I86__) \ - || defined(__INTEL__) \ - || defined(__X86__) \ - || defined(__386__) \ - || defined(__I86__) \ - || defined(M_I386) \ - || defined(M_I86) \ - || defined(_M_I386) \ - || defined(_M_I86) \ - || defined(__arm__) - #if defined(_WIN32) \ - || defined(_WIN64) \ - || defined(__WIN32__) \ - || defined(__TOS_WIN__) \ - || defined(__WINDOWS__) \ - || defined(_WINDOWS) \ - || defined(__WINDOWS_386__) \ - || defined(__CYGWIN__) - /* Either Windows or Phar Lap ETS. */ - #define NiFpga_Windows 1 - #elif defined(__linux) \ - || defined(__linux__) \ - || defined(__gnu_linux__) \ - || defined(linux) - #define NiFpga_Linux 1 - #else - #error Unsupported OS. - #endif -#elif defined(__powerpc) \ - || defined(__powerpc__) \ - || defined(__POWERPC__) \ - || defined(__ppc__) \ - || defined(__PPC) \ - || defined(_M_PPC) \ - || defined(_ARCH_PPC) \ - || defined(__PPC__) \ - || defined(__ppc) - #if defined(__vxworks) - #define NiFpga_VxWorks 1 - #else - #error Unsupported OS. - #endif -#else - #error Unsupported architecture. -#endif - -/* - * Determine compiler. - */ -#if defined(_MSC_VER) - #define NiFpga_Msvc 1 -#elif defined(__GNUC__) - #define NiFpga_Gcc 1 -#elif defined(_CVI_) && !defined(_TPC_) - #define NiFpga_Cvi 1 - /* Enables CVI Library Protection Errors. */ - #pragma EnableLibraryRuntimeChecking -#else - /* Unknown compiler. */ -#endif - -/* - * Determine compliance with different C/C++ language standards. - */ -#if defined(__cplusplus) - #define NiFpga_Cpp 1 - #if __cplusplus >= 199707L - #define NiFpga_Cpp98 1 - #endif -#endif -#if defined(__STDC__) - #define NiFpga_C89 1 - #if defined(__STDC_VERSION__) - #define NiFpga_C90 1 - #if __STDC_VERSION__ >= 199409L - #define NiFpga_C94 1 - #if __STDC_VERSION__ >= 199901L - #define NiFpga_C99 1 - #endif - #endif - #endif -#endif - -/* - * Determine ability to inline functions. - */ -#if NiFpga_Cpp || NiFpga_C99 - /* The inline keyword exists in C++ and C99. */ - #define NiFpga_Inline inline -#elif NiFpga_Msvc - /* Visual C++ (at least since 6.0) also supports an alternate keyword. */ - #define NiFpga_Inline __inline -#elif NiFpga_Gcc - /* GCC (at least since 2.95.2) also supports an alternate keyword. */ - #define NiFpga_Inline __inline__ -#elif !defined(NiFpga_Inline) - /* - * Disable inlining if inline support is unknown. To manually enable - * inlining, #define the following macro before #including NiFpga.h: - * - * #define NiFpga_Inline inline - */ - #define NiFpga_Inline -#endif - -/* - * Define exact-width integer types, if they have not already been defined. - */ -#if NiFpga_ExactWidthIntegerTypesDefined \ - || defined(_STDINT) \ - || defined(_STDINT_H) \ - || defined(_STDINT_H_) \ - || defined(_INTTYPES_H) \ - || defined(_INTTYPES_H_) \ - || defined(_SYS_STDINT_H) \ - || defined(_SYS_STDINT_H_) \ - || defined(_SYS_INTTYPES_H) \ - || defined(_SYS_INTTYPES_H_) \ - || defined(_STDINT_H_INCLUDED) \ - || defined(BOOST_CSTDINT_HPP) \ - || defined(_MSC_STDINT_H_) \ - || defined(_PSTDINT_H_INCLUDED) - /* Assume that exact-width integer types have already been defined. */ -#elif NiFpga_VxWorks - #include -#elif NiFpga_C99 \ - || NiFpga_Gcc /* GCC (at least since 3.0) has a stdint.h. */ \ - || defined(HAVE_STDINT_H) - /* Assume that stdint.h can be included. */ - #include -#elif NiFpga_Msvc \ - || NiFpga_Cvi - /* Manually define exact-width integer types. */ - typedef signed char int8_t; - typedef unsigned char uint8_t; - typedef short int16_t; - typedef unsigned short uint16_t; - typedef int int32_t; - typedef unsigned int uint32_t; - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; -#else - /* - * Exact-width integer types must be defined by the user, and the following - * macro must be #defined, before #including NiFpga.h: - * - * #define NiFpga_ExactWidthIntegerTypesDefined 1 - */ - #error Exact-width integer types must be defined by the user. See comment. -#endif - -/* Included for definition of size_t. */ -#include - -#if NiFpga_Cpp -extern "C" { -#endif - -/** - * A boolean value; either NiFpga_False or NiFpga_True. - */ -typedef uint8_t NiFpga_Bool; - -/** - * Represents a false condition. - */ -static const NiFpga_Bool NiFpga_False = 0; - -/** - * Represents a true condition. - */ -static const NiFpga_Bool NiFpga_True = 1; - -/** - * Represents the resulting status of a function call through its return value. - * 0 is success, negative values are errors, and positive values are warnings. - */ -typedef int32_t NiFpga_Status; - -/** - * No errors or warnings. - */ -static const NiFpga_Status NiFpga_Status_Success = 0; - -/** - * The timeout expired before the FIFO operation could complete. - */ -static const NiFpga_Status NiFpga_Status_FifoTimeout = -50400; - -/** - * A memory allocation failed. Try again after rebooting. - */ -static const NiFpga_Status NiFpga_Status_MemoryFull = -52000; - -/** - * An unexpected software error occurred. - */ -static const NiFpga_Status NiFpga_Status_SoftwareFault = -52003; - -/** - * A parameter to a function was not valid. This could be a NULL pointer, a bad - * value, etc. - */ -static const NiFpga_Status NiFpga_Status_InvalidParameter = -52005; - -/** - * A required resource was not found. The NiFpga.* library, the RIO resource, - * or some other resource may be missing, or the NiFpga.* library may not be - * the required minimum version. - */ -static const NiFpga_Status NiFpga_Status_ResourceNotFound = -52006; - -/** - * A required resource was not properly initialized. This could occur if - * NiFpga_Initialize was not called or a required NiFpga_IrqContext was not - * reserved. - */ -static const NiFpga_Status NiFpga_Status_ResourceNotInitialized = -52010; - -/** - * The FPGA is already running. - */ -static const NiFpga_Status NiFpga_Status_FpgaAlreadyRunning = -61003; - -/** - * The bitfile was not compiled for the specified resource's device type. - */ -static const NiFpga_Status NiFpga_Status_DeviceTypeMismatch = -61024; - -/** - * An error was detected in the communication between the host computer and the - * FPGA target. - */ -static const NiFpga_Status NiFpga_Status_CommunicationTimeout = -61046; - -/** - * The timeout expired before any of the IRQs were asserted. - */ -static const NiFpga_Status NiFpga_Status_IrqTimeout = -61060; - -/** - * The specified bitfile is invalid or corrupt. - */ -static const NiFpga_Status NiFpga_Status_CorruptBitfile = -61070; - -/** - * The FIFO depth is invalid. It was either 0, greater than the amount of - * available memory in the host computer, or greater than the maximum size - * allowed by the hardware. - */ -static const NiFpga_Status NiFpga_Status_BadDepth = -61072; - -/** - * The number of FIFO elements is invalid. Either the number is greater than - * the depth of the host memory DMA FIFO, or more elements were requested for - * release than had been acquired. - */ -static const NiFpga_Status NiFpga_Status_BadReadWriteCount = -61073; - -/** - * A hardware clocking error occurred. A derived clock lost lock with its base - * clock during the execution of the LabVIEW FPGA VI. If any base clocks with - * derived clocks are referencing an external source, make sure that the - * external source is connected and within the supported frequency, jitter, - * accuracy, duty cycle, and voltage specifications. Also verify that the - * characteristics of the base clock match the configuration specified in the - * FPGA Base Clock Properties. If all base clocks with derived clocks are - * generated from free-running, on-board sources, please contact National - * Instruments technical support at ni.com/support. - */ -static const NiFpga_Status NiFpga_Status_ClockLostLock = -61083; - -/** - * Operation could not be performed because the FPGA is busy. Stop all the - * activities on the FPGA before requesting this operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusy = -61141; - -/** - * Operation could not be performed because the FPGA is busy operating in FPGA - * Interface C API mode. Stop all the activities on the FPGA before requesting - * this operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterfaceCApi = -61200; - -/** - * The chassis is in Scan Interface programming mode. In order to run FPGA VIs, - * you must go to the chassis properties page, select FPGA programming mode, - * and deploy settings. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyScanInterface = -61201; - -/** - * Operation could not be performed because the FPGA is busy operating in FPGA - * Interface mode. Stop all the activities on the FPGA before requesting this - * operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterface = -61202; - -/** - * Operation could not be performed because the FPGA is busy operating in - * Interactive mode. Stop all the activities on the FPGA before requesting this - * operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyInteractive = -61203; - -/** - * Operation could not be performed because the FPGA is busy operating in - * Emulation mode. Stop all the activities on the FPGA before requesting this - * operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyEmulation = -61204; - -/** - * An unexpected internal error occurred. - */ -static const NiFpga_Status NiFpga_Status_InternalError = -61499; - -/** - * Access to the remote system was denied. Use MAX to check the Remote Device - * Access settings under Software>>NI-RIO>>NI-RIO Settings on the remote system. - */ -static const NiFpga_Status NiFpga_Status_AccessDenied = -63033; - -/** - * A connection could not be established to the specified remote device. Ensure - * that the device is on and accessible over the network, that NI-RIO software - * is installed, and that the RIO server is running and properly configured. - */ -static const NiFpga_Status NiFpga_Status_RpcConnectionError = -63040; - -/** - * The RPC session is invalid. The target may have reset or been rebooted. Check - * the network connection and retry the operation. - */ -static const NiFpga_Status NiFpga_Status_RpcSessionError = -63043; - -/** - * A Read FIFO or Write FIFO function was called while the host had acquired - * elements of the FIFO. Release all acquired elements before reading or - * writing. - */ -static const NiFpga_Status NiFpga_Status_FifoElementsCurrentlyAcquired = -63083; - -/** - * The bitfile could not be read. - */ -static const NiFpga_Status NiFpga_Status_BitfileReadError = -63101; - -/** - * The specified signature does not match the signature of the bitfile. If the - * bitfile has been recompiled, regenerate the C API and rebuild the - * application. - */ -static const NiFpga_Status NiFpga_Status_SignatureMismatch = -63106; - -/** - * Either the supplied resource name is invalid as a RIO resource name, or the - * device was not found. Use MAX to find the proper resource name for the - * intended device. - */ -static const NiFpga_Status NiFpga_Status_InvalidResourceName = -63192; - -/** - * The requested feature is not supported. - */ -static const NiFpga_Status NiFpga_Status_FeatureNotSupported = -63193; - -/** - * The NI-RIO software on the remote system is not compatible with the local - * NI-RIO software. Upgrade the NI-RIO software on the remote system. - */ -static const NiFpga_Status NiFpga_Status_VersionMismatch = -63194; - -/** - * The session is invalid or has been closed. - */ -static const NiFpga_Status NiFpga_Status_InvalidSession = -63195; - -/** - * The maximum number of open FPGA sessions has been reached. Close some open - * sessions. - */ -static const NiFpga_Status NiFpga_Status_OutOfHandles = -63198; - -/** - * Tests whether a status is an error. - * - * @param status status to check for an error - * @return whether the status was an error - */ -static NiFpga_Inline NiFpga_Bool NiFpga_IsError(const NiFpga_Status status) -{ - return status < NiFpga_Status_Success; -} - -/** - * Tests whether a status is not an error. Success and warnings are not errors. - * - * @param status status to check for an error - * @return whether the status was a success or warning - */ -static NiFpga_Inline NiFpga_Bool NiFpga_IsNotError(const NiFpga_Status status) -{ - return status >= NiFpga_Status_Success; -} - -/** - * Conditionally sets the status to a new value. The previous status is - * preserved unless the new status is more of an error, which means that - * warnings and errors overwrite successes, and errors overwrite warnings. New - * errors do not overwrite older errors, and new warnings do not overwrite - * older warnings. - * - * @param status status to conditionally set - * @param newStatus new status value that may be set - * @return the resulting status - */ -static NiFpga_Inline NiFpga_Status NiFpga_MergeStatus( - NiFpga_Status* const status, - const NiFpga_Status newStatus) -{ - if (!status) - { - return NiFpga_Status_InvalidParameter; - } - if (NiFpga_IsNotError(*status) - && (*status == NiFpga_Status_Success || NiFpga_IsError(newStatus))) - { - *status = newStatus; - } - return *status; -} - -/** - * This macro evaluates the expression only if the status is not an error. The - * expression must evaluate to an NiFpga_Status, such as a call to any NiFpga_* - * function, because the status will be set to the returned status if the - * expression is evaluated. - * - * You can use this macro to mimic status chaining in LabVIEW, where the status - * does not have to be explicitly checked after each call. Such code may look - * like the following example. - * - * NiFpga_Status status = NiFpga_Status_Success; - * NiFpga_IfIsNotError(status, NiFpga_WriteU32(...)); - * NiFpga_IfIsNotError(status, NiFpga_WriteU32(...)); - * NiFpga_IfIsNotError(status, NiFpga_WriteU32(...)); - * - * @param status status to check for an error - * @param expression expression to call if the incoming status is not an error - */ -#define NiFpga_IfIsNotError(status, expression) \ - if (NiFpga_IsNotError(status)) \ - { \ - NiFpga_MergeStatus(&status, (expression)); \ - } - -/** - * You must call this function before all other function calls. This function - * loads the NiFpga library so that all the other functions will work. If this - * function succeeds, you must call NiFpga_Finalize after all other function - * calls. - * - * @warning This function is not thread safe. - * - * @return result of the call - */ -NiFpga_Status NiFpga_Initialize(void); - -/** - * You must call this function after all other function calls if - * NiFpga_Initialize succeeds. This function unloads the NiFpga library. - * - * @warning This function is not thread safe. - * - * @return result of the call - */ -NiFpga_Status NiFpga_Finalize(void); - -/** - * A handle to an FPGA session. - */ -typedef uint32_t NiFpga_Session; - -/** - * Attributes that NiFpga_Open accepts. - */ -typedef enum -{ - NiFpga_OpenAttribute_NoRun = 1 -} NiFpga_OpenAttribute; - -/** - * Opens a session to the FPGA. This call ensures that the contents of the - * bitfile are programmed to the FPGA. The FPGA runs unless the - * NiFpga_OpenAttribute_NoRun attribute is used. - * - * Because different operating systems have different default current working - * directories for applications, you must pass an absolute path for the bitfile - * parameter. If you pass only the filename instead of an absolute path, the - * operating system may not be able to locate the bitfile. For example, the - * default current working directories are C:\ni-rt\system\ for Phar Lap ETS and - * /c/ for VxWorks. Because the generated *_Bitfile constant is a #define to a - * string literal, you can use C/C++ string-literal concatenation to form an - * absolute path. For example, if the bitfile is in the root directory of a - * Phar Lap ETS system, pass the following for the bitfile parameter. - * - * "C:\\" NiFpga_MyApplication_Bitfile - * - * @param bitfile path to the bitfile - * @param signature signature of the bitfile - * @param resource RIO resource string to open ("RIO0" or "rio://mysystem/RIO") - * @param attribute bitwise OR of any NiFpga_OpenAttributes, or 0 - * @param session outputs the session handle, which must be closed when no - * longer needed - * @return result of the call - */ -NiFpga_Status NiFpga_Open(const char* bitfile, - const char* signature, - const char* resource, - uint32_t attribute, - NiFpga_Session* session); - -/** - * Attributes that NiFpga_Close accepts. - */ -typedef enum -{ - NiFpga_CloseAttribute_NoResetIfLastSession = 1 -} NiFpga_CloseAttribute; - -/** - * Closes the session to the FPGA. The FPGA resets unless either another session - * is still open or you use the NiFpga_CloseAttribute_NoResetIfLastSession - * attribute. - * - * @param session handle to a currently open session - * @param attribute bitwise OR of any NiFpga_CloseAttributes, or 0 - * @return result of the call - */ -NiFpga_Status NiFpga_Close(NiFpga_Session session, - uint32_t attribute); - -/** - * Attributes that NiFpga_Run accepts. - */ -typedef enum -{ - NiFpga_RunAttribute_WaitUntilDone = 1 -} NiFpga_RunAttribute; - -/** - * Runs the FPGA VI on the target. If you use NiFpga_RunAttribute_WaitUntilDone, - * NiFpga_Run blocks the thread until the FPGA finishes running (if ever). - * - * @param session handle to a currently open session - * @param attribute bitwise OR of any NiFpga_RunAttributes, or 0 - * @return result of the call - */ -NiFpga_Status NiFpga_Run(NiFpga_Session session, - uint32_t attribute); - -/** - * Aborts the FPGA VI. - * - * @param session handle to a currently open session - * @return result of the call - */ -NiFpga_Status NiFpga_Abort(NiFpga_Session session); - -/** - * Resets the FPGA VI. - * - * @param session handle to a currently open session - * @return result of the call - */ -NiFpga_Status NiFpga_Reset(NiFpga_Session session); - -/** - * Re-downloads the FPGA bitstream to the target. - * - * @param session handle to a currently open session - * @return result of the call - */ -NiFpga_Status NiFpga_Download(NiFpga_Session session); - -/** - * Reads a boolean value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadBool(NiFpga_Session session, - uint32_t indicator, - NiFpga_Bool* value); - -/** - * Reads a signed 8-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI8(NiFpga_Session session, - uint32_t indicator, - int8_t* value); - -/** - * Reads an unsigned 8-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU8(NiFpga_Session session, - uint32_t indicator, - uint8_t* value); - -/** - * Reads a signed 16-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI16(NiFpga_Session session, - uint32_t indicator, - int16_t* value); - -/** - * Reads an unsigned 16-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU16(NiFpga_Session session, - uint32_t indicator, - uint16_t* value); - -/** - * Reads a signed 32-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI32(NiFpga_Session session, - uint32_t indicator, - int32_t* value); - -/** - * Reads an unsigned 32-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU32(NiFpga_Session session, - uint32_t indicator, - uint32_t* value); - -/** - * Reads a signed 64-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI64(NiFpga_Session session, - uint32_t indicator, - int64_t* value); - -/** - * Reads an unsigned 64-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU64(NiFpga_Session session, - uint32_t indicator, - uint64_t* value); - -/** - * Writes a boolean value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteBool(NiFpga_Session session, - uint32_t control, - NiFpga_Bool value); - -/** - * Writes a signed 8-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI8(NiFpga_Session session, - uint32_t control, - int8_t value); - -/** - * Writes an unsigned 8-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU8(NiFpga_Session session, - uint32_t control, - uint8_t value); - -/** - * Writes a signed 16-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI16(NiFpga_Session session, - uint32_t control, - int16_t value); - -/** - * Writes an unsigned 16-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU16(NiFpga_Session session, - uint32_t control, - uint16_t value); - -/** - * Writes a signed 32-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI32(NiFpga_Session session, - uint32_t control, - int32_t value); - -/** - * Writes an unsigned 32-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU32(NiFpga_Session session, - uint32_t control, - uint32_t value); - -/** - * Writes a signed 64-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI64(NiFpga_Session session, - uint32_t control, - int64_t value); - -/** - * Writes an unsigned 64-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU64(NiFpga_Session session, - uint32_t control, - uint64_t value); - -/** - * Reads an entire array of boolean values from a given array indicator or - * control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayBool(NiFpga_Session session, - uint32_t indicator, - NiFpga_Bool* array, - size_t size); - -/** - * Reads an entire array of signed 8-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI8(NiFpga_Session session, - uint32_t indicator, - int8_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 8-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU8(NiFpga_Session session, - uint32_t indicator, - uint8_t* array, - size_t size); - -/** - * Reads an entire array of signed 16-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI16(NiFpga_Session session, - uint32_t indicator, - int16_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 16-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU16(NiFpga_Session session, - uint32_t indicator, - uint16_t* array, - size_t size); - -/** - * Reads an entire array of signed 32-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI32(NiFpga_Session session, - uint32_t indicator, - int32_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 32-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU32(NiFpga_Session session, - uint32_t indicator, - uint32_t* array, - size_t size); - -/** - * Reads an entire array of signed 64-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI64(NiFpga_Session session, - uint32_t indicator, - int64_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 64-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU64(NiFpga_Session session, - uint32_t indicator, - uint64_t* array, - size_t size); - -/** - * Writes an entire array of boolean values to a given array control or - * indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayBool(NiFpga_Session session, - uint32_t control, - const NiFpga_Bool* array, - size_t size); - -/** - * Writes an entire array of signed 8-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI8(NiFpga_Session session, - uint32_t control, - const int8_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 8-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU8(NiFpga_Session session, - uint32_t control, - const uint8_t* array, - size_t size); - -/** - * Writes an entire array of signed 16-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI16(NiFpga_Session session, - uint32_t control, - const int16_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 16-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU16(NiFpga_Session session, - uint32_t control, - const uint16_t* array, - size_t size); - -/** - * Writes an entire array of signed 32-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI32(NiFpga_Session session, - uint32_t control, - const int32_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 32-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU32(NiFpga_Session session, - uint32_t control, - const uint32_t* array, - size_t size); - -/** - * Writes an entire array of signed 64-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI64(NiFpga_Session session, - uint32_t control, - const int64_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 64-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU64(NiFpga_Session session, - uint32_t control, - const uint64_t* array, - size_t size); - -/** - * Enumeration of all 32 possible IRQs. Multiple IRQs can be bitwise ORed - * together like this: - * - * NiFpga_Irq_3 | NiFpga_Irq_23 - */ -typedef enum -{ - NiFpga_Irq_0 = 1 << 0, - NiFpga_Irq_1 = 1 << 1, - NiFpga_Irq_2 = 1 << 2, - NiFpga_Irq_3 = 1 << 3, - NiFpga_Irq_4 = 1 << 4, - NiFpga_Irq_5 = 1 << 5, - NiFpga_Irq_6 = 1 << 6, - NiFpga_Irq_7 = 1 << 7, - NiFpga_Irq_8 = 1 << 8, - NiFpga_Irq_9 = 1 << 9, - NiFpga_Irq_10 = 1 << 10, - NiFpga_Irq_11 = 1 << 11, - NiFpga_Irq_12 = 1 << 12, - NiFpga_Irq_13 = 1 << 13, - NiFpga_Irq_14 = 1 << 14, - NiFpga_Irq_15 = 1 << 15, - NiFpga_Irq_16 = 1 << 16, - NiFpga_Irq_17 = 1 << 17, - NiFpga_Irq_18 = 1 << 18, - NiFpga_Irq_19 = 1 << 19, - NiFpga_Irq_20 = 1 << 20, - NiFpga_Irq_21 = 1 << 21, - NiFpga_Irq_22 = 1 << 22, - NiFpga_Irq_23 = 1 << 23, - NiFpga_Irq_24 = 1 << 24, - NiFpga_Irq_25 = 1 << 25, - NiFpga_Irq_26 = 1 << 26, - NiFpga_Irq_27 = 1 << 27, - NiFpga_Irq_28 = 1 << 28, - NiFpga_Irq_29 = 1 << 29, - NiFpga_Irq_30 = 1 << 30, - NiFpga_Irq_31 = 1U << 31 -} NiFpga_Irq; - -/** - * Represents an infinite timeout. - */ -static const uint32_t NiFpga_InfiniteTimeout = 0xFFFFFFFF; - -/** - * See NiFpga_ReserveIrqContext for more information. - */ -typedef void* NiFpga_IrqContext; - -/** - * IRQ contexts are single-threaded; only one thread can wait with a particular - * context at any given time. Clients must reserve as many contexts as the - * application requires. - * - * If a context is successfully reserved (the returned status is not an error), - * it must be unreserved later. Otherwise a memory leak will occur. - * - * @param session handle to a currently open session - * @param context outputs the IRQ context - * @return result of the call - */ -NiFpga_Status NiFpga_ReserveIrqContext(NiFpga_Session session, - NiFpga_IrqContext* context); - -/** - * Unreserves an IRQ context obtained from NiFpga_ReserveIrqContext. - * - * @param session handle to a currently open session - * @param context IRQ context to unreserve - * @return result of the call - */ -NiFpga_Status NiFpga_UnreserveIrqContext(NiFpga_Session session, - NiFpga_IrqContext context); - -/** - * This is a blocking function that stops the calling thread until the FPGA - * asserts any IRQ in the irqs parameter, or until the function call times out. - * Before calling this function, you must use NiFpga_ReserveIrqContext to - * reserve an IRQ context. No other threads can use the same context when this - * function is called. - * - * You can use the irqsAsserted parameter to determine which IRQs were asserted - * for each function call. - * - * @param session handle to a currently open session - * @param context IRQ context with which to wait - * @param irqs bitwise OR of NiFpga_Irqs - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param irqsAsserted if non-NULL, outputs bitwise OR of IRQs that were - * asserted - * @param timedOut if non-NULL, outputs whether the timeout expired - * @return result of the call - */ -NiFpga_Status NiFpga_WaitOnIrqs(NiFpga_Session session, - NiFpga_IrqContext context, - uint32_t irqs, - uint32_t timeout, - uint32_t* irqsAsserted, - NiFpga_Bool* timedOut); - -/** - * Acknowledges an IRQ or set of IRQs. - * - * @param session handle to a currently open session - * @param irqs bitwise OR of NiFpga_Irqs - * @return result of the call - */ -NiFpga_Status NiFpga_AcknowledgeIrqs(NiFpga_Session session, - uint32_t irqs); - -/** - * Specifies the depth of the host memory part of the DMA FIFO. This method is - * optional. In order to see the actual depth configured, use - * NiFpga_ConfigureFifo2. - * - * @param session handle to a currently open session - * @param fifo FIFO to configure - * @param depth requested number of elements in the host memory part of the - * DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ConfigureFifo(NiFpga_Session session, - uint32_t fifo, - size_t depth); - -/** - * Specifies the depth of the host memory part of the DMA FIFO. This method is - * optional. - * - * @param session handle to a currently open session - * @param fifo FIFO to configure - * @param requestedDepth requested number of elements in the host memory part - * of the DMA FIFO - * @param actualDepth if non-NULL, outputs the actual number of elements in the - * host memory part of the DMA FIFO, which may be more than - * the requested number - * @return result of the call - */ -NiFpga_Status NiFpga_ConfigureFifo2(NiFpga_Session session, - uint32_t fifo, - size_t requestedDepth, - size_t* actualDepth); -/** - * Starts a FIFO. This method is optional. - * - * @param session handle to a currently open session - * @param fifo FIFO to start - * @return result of the call - */ -NiFpga_Status NiFpga_StartFifo(NiFpga_Session session, - uint32_t fifo); - -/** - * Stops a FIFO. This method is optional. - * - * @param session handle to a currently open session - * @param fifo FIFO to stop - * @return result of the call - */ -NiFpga_Status NiFpga_StopFifo(NiFpga_Session session, - uint32_t fifo); - -/** - * Reads from a target-to-host FIFO of booleans. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoBool(NiFpga_Session session, - uint32_t fifo, - NiFpga_Bool* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI8(NiFpga_Session session, - uint32_t fifo, - int8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU8(NiFpga_Session session, - uint32_t fifo, - uint8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI16(NiFpga_Session session, - uint32_t fifo, - int16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU16(NiFpga_Session session, - uint32_t fifo, - uint16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI32(NiFpga_Session session, - uint32_t fifo, - int32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU32(NiFpga_Session session, - uint32_t fifo, - uint32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI64(NiFpga_Session session, - uint32_t fifo, - int64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU64(NiFpga_Session session, - uint32_t fifo, - uint64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Writes to a host-to-target FIFO of booleans. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoBool(NiFpga_Session session, - uint32_t fifo, - const NiFpga_Bool* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI8(NiFpga_Session session, - uint32_t fifo, - const int8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU8(NiFpga_Session session, - uint32_t fifo, - const uint8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI16(NiFpga_Session session, - uint32_t fifo, - const int16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU16(NiFpga_Session session, - uint32_t fifo, - const uint16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI32(NiFpga_Session session, - uint32_t fifo, - const int32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU32(NiFpga_Session session, - uint32_t fifo, - const uint32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI64(NiFpga_Session session, - uint32_t fifo, - const int64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU64(NiFpga_Session session, - uint32_t fifo, - const uint64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of booleans. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsBool( - NiFpga_Session session, - uint32_t fifo, - NiFpga_Bool** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 8-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI8( - NiFpga_Session session, - uint32_t fifo, - int8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 8-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU8( - NiFpga_Session session, - uint32_t fifo, - uint8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 16-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI16( - NiFpga_Session session, - uint32_t fifo, - int16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 16-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU16( - NiFpga_Session session, - uint32_t fifo, - uint16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 32-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI32( - NiFpga_Session session, - uint32_t fifo, - int32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 32-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU32( - NiFpga_Session session, - uint32_t fifo, - uint32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 64-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI64( - NiFpga_Session session, - uint32_t fifo, - int64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 64-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU64( - NiFpga_Session session, - uint32_t fifo, - uint64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of booleans. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsBool( - NiFpga_Session session, - uint32_t fifo, - NiFpga_Bool** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 8-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI8( - NiFpga_Session session, - uint32_t fifo, - int8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 8-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU8( - NiFpga_Session session, - uint32_t fifo, - uint8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 16-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI16( - NiFpga_Session session, - uint32_t fifo, - int16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 16-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU16( - NiFpga_Session session, - uint32_t fifo, - uint16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 32-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI32( - NiFpga_Session session, - uint32_t fifo, - int32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 32-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU32( - NiFpga_Session session, - uint32_t fifo, - uint32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 64-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI64( - NiFpga_Session session, - uint32_t fifo, - int64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 64-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU64( - NiFpga_Session session, - uint32_t fifo, - uint64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Releases previously acquired FIFO elements. - * - * The FPGA target cannot read elements acquired by the host. Therefore, the - * host must release elements after acquiring them. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo FIFO from which to release elements - * @param elements number of elements to release - * @return result of the call - */ -NiFpga_Status NiFpga_ReleaseFifoElements(NiFpga_Session session, - uint32_t fifo, - size_t elements); - -/** - * Gets an endpoint reference to a peer-to-peer FIFO. - * - * @param session handle to a currently open session - * @param fifo peer-to-peer FIFO - * @param endpoint outputs the endpoint reference - * @return result of the call - */ -NiFpga_Status NiFpga_GetPeerToPeerFifoEndpoint(NiFpga_Session session, - uint32_t fifo, - uint32_t* endpoint); - -#if NiFpga_Cpp -} -#endif - -#endif diff --git a/hal/AthenaXX/src/main/native/ChipObject/NiRio.h b/hal/AthenaXX/src/main/native/ChipObject/NiRio.h deleted file mode 100644 index c0dc29ec35..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/NiRio.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __NiRio_h__ -#define __NiRio_h__ - -#include "NiFpga.h" -typedef NiFpga_Status tRioStatusCode; - -#endif // __NiRio_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/nInterfaceGlobals.h b/hal/AthenaXX/src/main/native/ChipObject/nInterfaceGlobals.h deleted file mode 100644 index b6c366cf9c..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/nInterfaceGlobals.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_nInterfaceGlobals_h__ -#define __nFRC_2012_1_6_4_nInterfaceGlobals_h__ - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - extern unsigned int g_currentTargetClass; -} -} - -#endif // __nFRC_2012_1_6_4_nInterfaceGlobals_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tAI.h b/hal/AthenaXX/src/main/native/ChipObject/tAI.h deleted file mode 100644 index 6316af666a..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tAI.h +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_AI_h__ -#define __nFRC_2012_1_6_4_AI_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAI -{ -public: - tAI(){} - virtual ~tAI(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAI* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 2, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Channel : 3; - unsigned Module : 1; - unsigned Averaged : 1; -#else - unsigned Averaged : 1; - unsigned Module : 1; - unsigned Channel : 3; -#endif - }; - struct{ - unsigned value : 5; - }; - } tReadSelect; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned ScanSize : 3; - unsigned ConvertRate : 26; -#else - unsigned ConvertRate : 26; - unsigned ScanSize : 3; -#endif - }; - struct{ - unsigned value : 29; - }; - } tConfig; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_ScanSize(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ConvertRate(unsigned int value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ScanSize(tRioStatusCode *status) = 0; - virtual unsigned int readConfig_ConvertRate(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLoopTiming_IfaceConstants; - - virtual unsigned int readLoopTiming(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumOversampleBitsElements = 8, - } tOversampleBits_IfaceConstants; - - virtual void writeOversampleBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readOversampleBits(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - kNumAverageBitsElements = 8, - } tAverageBits_IfaceConstants; - - virtual void writeAverageBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readAverageBits(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - kNumScanListElements = 8, - } tScanList_IfaceConstants; - - virtual void writeScanList(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readScanList(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual signed int readOutput(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLatchOutput_IfaceConstants; - - virtual void strobeLatchOutput(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReadSelect_IfaceConstants; - - virtual void writeReadSelect(tReadSelect value, tRioStatusCode *status) = 0; - virtual void writeReadSelect_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeReadSelect_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeReadSelect_Averaged(bool value, tRioStatusCode *status) = 0; - virtual tReadSelect readReadSelect(tRioStatusCode *status) = 0; - virtual unsigned char readReadSelect_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readReadSelect_Module(tRioStatusCode *status) = 0; - virtual bool readReadSelect_Averaged(tRioStatusCode *status) = 0; - - - - -private: - tAI(const tAI&); - void operator=(const tAI&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_AI_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tAccumulator.h b/hal/AthenaXX/src/main/native/ChipObject/tAccumulator.h deleted file mode 100644 index d182882dd7..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tAccumulator.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Accumulator_h__ -#define __nFRC_2012_1_6_4_Accumulator_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAccumulator -{ -public: - tAccumulator(){} - virtual ~tAccumulator(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAccumulator* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 2, - } tIfaceConstants; - - typedef - union{ - struct{ - signed long long Value; - unsigned Count : 32; - }; - struct{ - unsigned value : 32; - unsigned value2 : 32; - unsigned value3 : 32; - }; - } tOutput; - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual tOutput readOutput(tRioStatusCode *status) = 0; - virtual signed long long readOutput_Value(tRioStatusCode *status) = 0; - virtual unsigned int readOutput_Count(tRioStatusCode *status) = 0; - - - typedef enum - { - } tCenter_IfaceConstants; - - virtual void writeCenter(signed int value, tRioStatusCode *status) = 0; - virtual signed int readCenter(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDeadband_IfaceConstants; - - virtual void writeDeadband(signed int value, tRioStatusCode *status) = 0; - virtual signed int readDeadband(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - - - -private: - tAccumulator(const tAccumulator&); - void operator=(const tAccumulator&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Accumulator_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tAlarm.h b/hal/AthenaXX/src/main/native/ChipObject/tAlarm.h deleted file mode 100644 index a1c2f516ea..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tAlarm.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Alarm_h__ -#define __nFRC_2012_1_6_4_Alarm_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAlarm -{ -public: - tAlarm(){} - virtual ~tAlarm(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAlarm* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - } tEnable_IfaceConstants; - - virtual void writeEnable(bool value, tRioStatusCode *status) = 0; - virtual bool readEnable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTriggerTime_IfaceConstants; - - virtual void writeTriggerTime(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readTriggerTime(tRioStatusCode *status) = 0; - - - - -private: - tAlarm(const tAlarm&); - void operator=(const tAlarm&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Alarm_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tAnalogTrigger.h b/hal/AthenaXX/src/main/native/ChipObject/tAnalogTrigger.h deleted file mode 100644 index 4fabd9cd9e..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tAnalogTrigger.h +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_AnalogTrigger_h__ -#define __nFRC_2012_1_6_4_AnalogTrigger_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAnalogTrigger -{ -public: - tAnalogTrigger(){} - virtual ~tAnalogTrigger(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAnalogTrigger* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 8, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned InHysteresis : 1; - unsigned OverLimit : 1; - unsigned Rising : 1; - unsigned Falling : 1; -#else - unsigned Falling : 1; - unsigned Rising : 1; - unsigned OverLimit : 1; - unsigned InHysteresis : 1; -#endif - }; - struct{ - unsigned value : 4; - }; - } tOutput; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Channel : 3; - unsigned Module : 1; - unsigned Averaged : 1; - unsigned Filter : 1; - unsigned FloatingRollover : 1; - signed RolloverLimit : 8; -#else - signed RolloverLimit : 8; - unsigned FloatingRollover : 1; - unsigned Filter : 1; - unsigned Averaged : 1; - unsigned Module : 1; - unsigned Channel : 3; -#endif - }; - struct{ - unsigned value : 15; - }; - } tSourceSelect; - - - typedef enum - { - } tSourceSelect_IfaceConstants; - - virtual void writeSourceSelect(tSourceSelect value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Averaged(bool value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Filter(bool value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_FloatingRollover(bool value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_RolloverLimit(signed short value, tRioStatusCode *status) = 0; - virtual tSourceSelect readSourceSelect(tRioStatusCode *status) = 0; - virtual unsigned char readSourceSelect_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readSourceSelect_Module(tRioStatusCode *status) = 0; - virtual bool readSourceSelect_Averaged(tRioStatusCode *status) = 0; - virtual bool readSourceSelect_Filter(tRioStatusCode *status) = 0; - virtual bool readSourceSelect_FloatingRollover(tRioStatusCode *status) = 0; - virtual signed short readSourceSelect_RolloverLimit(tRioStatusCode *status) = 0; - - - typedef enum - { - } tUpperLimit_IfaceConstants; - - virtual void writeUpperLimit(signed int value, tRioStatusCode *status) = 0; - virtual signed int readUpperLimit(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLowerLimit_IfaceConstants; - - virtual void writeLowerLimit(signed int value, tRioStatusCode *status) = 0; - virtual signed int readLowerLimit(tRioStatusCode *status) = 0; - - - - typedef enum - { - kNumOutputElements = 8, - } tOutput_IfaceConstants; - - virtual tOutput readOutput(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_InHysteresis(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_OverLimit(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_Rising(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_Falling(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - -private: - tAnalogTrigger(const tAnalogTrigger&); - void operator=(const tAnalogTrigger&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_AnalogTrigger_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tCounter.h b/hal/AthenaXX/src/main/native/ChipObject/tCounter.h deleted file mode 100644 index 200ffb348f..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tCounter.h +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Counter_h__ -#define __nFRC_2012_1_6_4_Counter_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tCounter -{ -public: - tCounter(){} - virtual ~tCounter(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tCounter* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 8, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Direction : 1; - signed Value : 31; -#else - signed Value : 31; - unsigned Direction : 1; -#endif - }; - struct{ - unsigned value : 32; - }; - } tOutput; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned UpSource_Channel : 4; - unsigned UpSource_Module : 1; - unsigned UpSource_AnalogTrigger : 1; - unsigned DownSource_Channel : 4; - unsigned DownSource_Module : 1; - unsigned DownSource_AnalogTrigger : 1; - unsigned IndexSource_Channel : 4; - unsigned IndexSource_Module : 1; - unsigned IndexSource_AnalogTrigger : 1; - unsigned IndexActiveHigh : 1; - unsigned UpRisingEdge : 1; - unsigned UpFallingEdge : 1; - unsigned DownRisingEdge : 1; - unsigned DownFallingEdge : 1; - unsigned Mode : 2; - unsigned PulseLengthThreshold : 6; - unsigned Enable : 1; -#else - unsigned Enable : 1; - unsigned PulseLengthThreshold : 6; - unsigned Mode : 2; - unsigned DownFallingEdge : 1; - unsigned DownRisingEdge : 1; - unsigned UpFallingEdge : 1; - unsigned UpRisingEdge : 1; - unsigned IndexActiveHigh : 1; - unsigned IndexSource_AnalogTrigger : 1; - unsigned IndexSource_Module : 1; - unsigned IndexSource_Channel : 4; - unsigned DownSource_AnalogTrigger : 1; - unsigned DownSource_Module : 1; - unsigned DownSource_Channel : 4; - unsigned UpSource_AnalogTrigger : 1; - unsigned UpSource_Module : 1; - unsigned UpSource_Channel : 4; -#endif - }; - struct{ - unsigned value : 32; - }; - } tConfig; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Period : 23; - signed Count : 8; - unsigned Stalled : 1; -#else - unsigned Stalled : 1; - signed Count : 8; - unsigned Period : 23; -#endif - }; - struct{ - unsigned value : 32; - }; - } tTimerOutput; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned StallPeriod : 24; - unsigned AverageSize : 7; - unsigned UpdateWhenEmpty : 1; -#else - unsigned UpdateWhenEmpty : 1; - unsigned AverageSize : 7; - unsigned StallPeriod : 24; -#endif - }; - struct{ - unsigned value : 32; - }; - } tTimerConfig; - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual tOutput readOutput(tRioStatusCode *status) = 0; - virtual bool readOutput_Direction(tRioStatusCode *status) = 0; - virtual signed int readOutput_Value(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpRisingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpFallingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownRisingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownFallingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Mode(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_PulseLengthThreshold(unsigned short value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_UpSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_UpSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_UpSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_DownSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_DownSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_DownSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0; - virtual bool readConfig_UpRisingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_UpFallingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_DownRisingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_DownFallingEdge(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_Mode(tRioStatusCode *status) = 0; - virtual unsigned short readConfig_PulseLengthThreshold(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerOutput_IfaceConstants; - - virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0; - virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0; - virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0; - virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerConfig_IfaceConstants; - - virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0; - virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0; - virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0; - virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0; - virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0; - - - - - -private: - tCounter(const tCounter&); - void operator=(const tCounter&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Counter_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tDIO.h b/hal/AthenaXX/src/main/native/ChipObject/tDIO.h deleted file mode 100644 index d9852c93ad..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tDIO.h +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_DIO_h__ -#define __nFRC_2012_1_6_4_DIO_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tDIO -{ -public: - tDIO(){} - virtual ~tDIO(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tDIO* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 2, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Period : 16; - unsigned MinHigh : 16; -#else - unsigned MinHigh : 16; - unsigned Period : 16; -#endif - }; - struct{ - unsigned value : 32; - }; - } tPWMConfig; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned RelayFwd : 8; - unsigned RelayRev : 8; - unsigned I2CHeader : 4; -#else - unsigned I2CHeader : 4; - unsigned RelayRev : 8; - unsigned RelayFwd : 8; -#endif - }; - struct{ - unsigned value : 20; - }; - } tSlowValue; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Transaction : 1; - unsigned Done : 1; - unsigned Aborted : 1; - unsigned DataReceivedHigh : 24; -#else - unsigned DataReceivedHigh : 24; - unsigned Aborted : 1; - unsigned Done : 1; - unsigned Transaction : 1; -#endif - }; - struct{ - unsigned value : 27; - }; - } tI2CStatus; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Address : 8; - unsigned BytesToRead : 3; - unsigned BytesToWrite : 3; - unsigned DataToSendHigh : 16; - unsigned BitwiseHandshake : 1; -#else - unsigned BitwiseHandshake : 1; - unsigned DataToSendHigh : 16; - unsigned BytesToWrite : 3; - unsigned BytesToRead : 3; - unsigned Address : 8; -#endif - }; - struct{ - unsigned value : 31; - }; - } tI2CConfig; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned PeriodPower : 4; - unsigned OutputSelect_0 : 4; - unsigned OutputSelect_1 : 4; - unsigned OutputSelect_2 : 4; - unsigned OutputSelect_3 : 4; -#else - unsigned OutputSelect_3 : 4; - unsigned OutputSelect_2 : 4; - unsigned OutputSelect_1 : 4; - unsigned OutputSelect_0 : 4; - unsigned PeriodPower : 4; -#endif - }; - struct{ - unsigned value : 20; - }; - } tDO_PWMConfig; - - - typedef enum - { - kNumFilterSelectElements = 16, - } tFilterSelect_IfaceConstants; - - virtual void writeFilterSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readFilterSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CDataToSend_IfaceConstants; - - virtual void writeI2CDataToSend(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readI2CDataToSend(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDO_IfaceConstants; - - virtual void writeDO(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readDO(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumFilterPeriodElements = 3, - } tFilterPeriod_IfaceConstants; - - virtual void writeFilterPeriod(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readFilterPeriod(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - } tOutputEnable_IfaceConstants; - - virtual void writeOutputEnable(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readOutputEnable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tPulse_IfaceConstants; - - virtual void writePulse(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readPulse(tRioStatusCode *status) = 0; - - - typedef enum - { - } tSlowValue_IfaceConstants; - - virtual void writeSlowValue(tSlowValue value, tRioStatusCode *status) = 0; - virtual void writeSlowValue_RelayFwd(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSlowValue_RelayRev(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSlowValue_I2CHeader(unsigned char value, tRioStatusCode *status) = 0; - virtual tSlowValue readSlowValue(tRioStatusCode *status) = 0; - virtual unsigned char readSlowValue_RelayFwd(tRioStatusCode *status) = 0; - virtual unsigned char readSlowValue_RelayRev(tRioStatusCode *status) = 0; - virtual unsigned char readSlowValue_I2CHeader(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CStatus_IfaceConstants; - - virtual tI2CStatus readI2CStatus(tRioStatusCode *status) = 0; - virtual unsigned char readI2CStatus_Transaction(tRioStatusCode *status) = 0; - virtual bool readI2CStatus_Done(tRioStatusCode *status) = 0; - virtual bool readI2CStatus_Aborted(tRioStatusCode *status) = 0; - virtual unsigned int readI2CStatus_DataReceivedHigh(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CDataReceived_IfaceConstants; - - virtual unsigned int readI2CDataReceived(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDI_IfaceConstants; - - virtual unsigned short readDI(tRioStatusCode *status) = 0; - - - typedef enum - { - } tPulseLength_IfaceConstants; - - virtual void writePulseLength(unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPulseLength(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumPWMPeriodScaleElements = 10, - } tPWMPeriodScale_IfaceConstants; - - virtual void writePWMPeriodScale(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPWMPeriodScale(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - kNumDO_PWMDutyCycleElements = 4, - } tDO_PWMDutyCycle_IfaceConstants; - - virtual void writeDO_PWMDutyCycle(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMDutyCycle(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - } tBFL_IfaceConstants; - - virtual void writeBFL(bool value, tRioStatusCode *status) = 0; - virtual bool readBFL(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CConfig_IfaceConstants; - - virtual void writeI2CConfig(tI2CConfig value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_Address(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_BytesToRead(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_BytesToWrite(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_DataToSendHigh(unsigned short value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_BitwiseHandshake(bool value, tRioStatusCode *status) = 0; - virtual tI2CConfig readI2CConfig(tRioStatusCode *status) = 0; - virtual unsigned char readI2CConfig_Address(tRioStatusCode *status) = 0; - virtual unsigned char readI2CConfig_BytesToRead(tRioStatusCode *status) = 0; - virtual unsigned char readI2CConfig_BytesToWrite(tRioStatusCode *status) = 0; - virtual unsigned short readI2CConfig_DataToSendHigh(tRioStatusCode *status) = 0; - virtual bool readI2CConfig_BitwiseHandshake(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDO_PWMConfig_IfaceConstants; - - virtual void writeDO_PWMConfig(tDO_PWMConfig value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_PeriodPower(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_0(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_1(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_2(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_3(unsigned char value, tRioStatusCode *status) = 0; - virtual tDO_PWMConfig readDO_PWMConfig(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_PeriodPower(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_0(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_1(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_2(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_3(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CStart_IfaceConstants; - - virtual void strobeI2CStart(tRioStatusCode *status) = 0; - - - - typedef enum - { - } tLoopTiming_IfaceConstants; - - virtual unsigned short readLoopTiming(tRioStatusCode *status) = 0; - - - typedef enum - { - } tPWMConfig_IfaceConstants; - - virtual void writePWMConfig(tPWMConfig value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_Period(unsigned short value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_MinHigh(unsigned short value, tRioStatusCode *status) = 0; - virtual tPWMConfig readPWMConfig(tRioStatusCode *status) = 0; - virtual unsigned short readPWMConfig_Period(tRioStatusCode *status) = 0; - virtual unsigned short readPWMConfig_MinHigh(tRioStatusCode *status) = 0; - - - - typedef enum - { - kNumPWMValueRegisters = 10, - } tPWMValue_IfaceConstants; - - virtual void writePWMValue(unsigned char reg_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPWMValue(unsigned char reg_index, tRioStatusCode *status) = 0; - - - -private: - tDIO(const tDIO&); - void operator=(const tDIO&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_DIO_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tDMA.h b/hal/AthenaXX/src/main/native/ChipObject/tDMA.h deleted file mode 100644 index c46cad2e0b..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tDMA.h +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_DMA_h__ -#define __nFRC_2012_1_6_4_DMA_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tDMA -{ -public: - tDMA(){} - virtual ~tDMA(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tDMA* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Pause : 1; - unsigned Enable_AI0_Low : 1; - unsigned Enable_AI0_High : 1; - unsigned Enable_AIAveraged0_Low : 1; - unsigned Enable_AIAveraged0_High : 1; - unsigned Enable_AI1_Low : 1; - unsigned Enable_AI1_High : 1; - unsigned Enable_AIAveraged1_Low : 1; - unsigned Enable_AIAveraged1_High : 1; - unsigned Enable_Accumulator0 : 1; - unsigned Enable_Accumulator1 : 1; - unsigned Enable_DI : 1; - unsigned Enable_AnalogTriggers : 1; - unsigned Enable_Counters_Low : 1; - unsigned Enable_Counters_High : 1; - unsigned Enable_CounterTimers_Low : 1; - unsigned Enable_CounterTimers_High : 1; - unsigned Enable_Encoders : 1; - unsigned Enable_EncoderTimers : 1; - unsigned ExternalClock : 1; -#else - unsigned ExternalClock : 1; - unsigned Enable_EncoderTimers : 1; - unsigned Enable_Encoders : 1; - unsigned Enable_CounterTimers_High : 1; - unsigned Enable_CounterTimers_Low : 1; - unsigned Enable_Counters_High : 1; - unsigned Enable_Counters_Low : 1; - unsigned Enable_AnalogTriggers : 1; - unsigned Enable_DI : 1; - unsigned Enable_Accumulator1 : 1; - unsigned Enable_Accumulator0 : 1; - unsigned Enable_AIAveraged1_High : 1; - unsigned Enable_AIAveraged1_Low : 1; - unsigned Enable_AI1_High : 1; - unsigned Enable_AI1_Low : 1; - unsigned Enable_AIAveraged0_High : 1; - unsigned Enable_AIAveraged0_Low : 1; - unsigned Enable_AI0_High : 1; - unsigned Enable_AI0_Low : 1; - unsigned Pause : 1; -#endif - }; - struct{ - unsigned value : 20; - }; - } tConfig; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned ExternalClockSource_Channel : 4; - unsigned ExternalClockSource_Module : 1; - unsigned ExternalClockSource_AnalogTrigger : 1; - unsigned RisingEdge : 1; - unsigned FallingEdge : 1; -#else - unsigned FallingEdge : 1; - unsigned RisingEdge : 1; - unsigned ExternalClockSource_AnalogTrigger : 1; - unsigned ExternalClockSource_Module : 1; - unsigned ExternalClockSource_Channel : 4; -#endif - }; - struct{ - unsigned value : 8; - }; - } tExternalTriggers; - - - - typedef enum - { - } tRate_IfaceConstants; - - virtual void writeRate(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readRate(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_Pause(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI0_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI0_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged0_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged0_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI1_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI1_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged1_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged1_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Accumulator0(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Accumulator1(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_DI(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AnalogTriggers(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Counters_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Counters_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_CounterTimers_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_CounterTimers_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Encoders(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_EncoderTimers(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_ExternalClock(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual bool readConfig_Pause(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI0_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI0_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged0_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged0_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI1_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI1_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged1_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged1_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Accumulator0(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Accumulator1(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_DI(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AnalogTriggers(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Counters_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Counters_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_CounterTimers_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_CounterTimers_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Encoders(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_EncoderTimers(tRioStatusCode *status) = 0; - virtual bool readConfig_ExternalClock(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumExternalTriggersElements = 4, - } tExternalTriggers_IfaceConstants; - - virtual void writeExternalTriggers(unsigned char bitfield_index, tExternalTriggers value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_ExternalClockSource_Channel(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_ExternalClockSource_Module(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_RisingEdge(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_FallingEdge(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0; - virtual tExternalTriggers readExternalTriggers(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual unsigned char readExternalTriggers_ExternalClockSource_Channel(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual unsigned char readExternalTriggers_ExternalClockSource_Module(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readExternalTriggers_RisingEdge(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readExternalTriggers_FallingEdge(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - -private: - tDMA(const tDMA&); - void operator=(const tDMA&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_DMA_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tDMAManager.h b/hal/AthenaXX/src/main/native/ChipObject/tDMAManager.h deleted file mode 100644 index ce292b1592..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tDMAManager.h +++ /dev/null @@ -1,46 +0,0 @@ -// Class for handling DMA transters. -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tDMAManager_h__ -#define __tDMAManager_h__ - -#include "tSystem.h" - -namespace nFPGA -{ -// TODO: Implement DMA Manager -/* -class tDMAManager : public tSystem -{ -public: - tDMAManager(tNIRIO_u32 dmaChannel, tNIRIO_u32 hostBufferSize, tRioStatusCode *status); - ~tDMAManager(); - void start(tRioStatusCode *status); - void stop(tRioStatusCode *status); - bool isStarted() {return _started;} - void read( - tNIRIO_u32* buf, - tNIRIO_u32 num, - tNIRIO_u32 timeout, - tNIRIO_u32* read, - tNIRIO_u32* remaining, - tRioStatusCode *status); - void write( - tNIRIO_u32* buf, - tNIRIO_u32 num, - tNIRIO_u32 timeout, - tNIRIO_u32* remaining, - tRioStatusCode *status); -private: - bool _started; - tNIRIO_u32 _dmaChannel; - tNIRIO_u32 _hostBufferSize; - tDMAChannelDescriptor const *_dmaChannelDescriptor; - -}; -*/ -} - - -#endif // __tDMAManager_h__ - diff --git a/hal/AthenaXX/src/main/native/ChipObject/tEncoder.h b/hal/AthenaXX/src/main/native/ChipObject/tEncoder.h deleted file mode 100644 index 0b68067f64..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tEncoder.h +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Encoder_h__ -#define __nFRC_2012_1_6_4_Encoder_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tEncoder -{ -public: - tEncoder(){} - virtual ~tEncoder(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tEncoder* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 4, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Direction : 1; - signed Value : 31; -#else - signed Value : 31; - unsigned Direction : 1; -#endif - }; - struct{ - unsigned value : 32; - }; - } tOutput; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned ASource_Channel : 4; - unsigned ASource_Module : 1; - unsigned ASource_AnalogTrigger : 1; - unsigned BSource_Channel : 4; - unsigned BSource_Module : 1; - unsigned BSource_AnalogTrigger : 1; - unsigned IndexSource_Channel : 4; - unsigned IndexSource_Module : 1; - unsigned IndexSource_AnalogTrigger : 1; - unsigned IndexActiveHigh : 1; - unsigned Reverse : 1; - unsigned Enable : 1; -#else - unsigned Enable : 1; - unsigned Reverse : 1; - unsigned IndexActiveHigh : 1; - unsigned IndexSource_AnalogTrigger : 1; - unsigned IndexSource_Module : 1; - unsigned IndexSource_Channel : 4; - unsigned BSource_AnalogTrigger : 1; - unsigned BSource_Module : 1; - unsigned BSource_Channel : 4; - unsigned ASource_AnalogTrigger : 1; - unsigned ASource_Module : 1; - unsigned ASource_Channel : 4; -#endif - }; - struct{ - unsigned value : 21; - }; - } tConfig; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Period : 23; - signed Count : 8; - unsigned Stalled : 1; -#else - unsigned Stalled : 1; - signed Count : 8; - unsigned Period : 23; -#endif - }; - struct{ - unsigned value : 32; - }; - } tTimerOutput; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned StallPeriod : 24; - unsigned AverageSize : 7; - unsigned UpdateWhenEmpty : 1; -#else - unsigned UpdateWhenEmpty : 1; - unsigned AverageSize : 7; - unsigned StallPeriod : 24; -#endif - }; - struct{ - unsigned value : 32; - }; - } tTimerConfig; - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual tOutput readOutput(tRioStatusCode *status) = 0; - virtual bool readOutput_Direction(tRioStatusCode *status) = 0; - virtual signed int readOutput_Value(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_ASource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ASource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ASource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_BSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_BSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_BSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Reverse(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ASource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ASource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_ASource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_BSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_BSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_BSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0; - virtual bool readConfig_Reverse(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerOutput_IfaceConstants; - - virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0; - virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0; - virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0; - virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerConfig_IfaceConstants; - - virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0; - virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0; - virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0; - virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0; - virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0; - - - - - -private: - tEncoder(const tEncoder&); - void operator=(const tEncoder&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Encoder_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tGlobal.h b/hal/AthenaXX/src/main/native/ChipObject/tGlobal.h deleted file mode 100644 index 2dbbbe78f3..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tGlobal.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Global_h__ -#define __nFRC_2012_1_6_4_Global_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tGlobal -{ -public: - tGlobal(){} - virtual ~tGlobal(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tGlobal* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - } tVersion_IfaceConstants; - - virtual unsigned short readVersion(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLocalTime_IfaceConstants; - - virtual unsigned int readLocalTime(tRioStatusCode *status) = 0; - - - typedef enum - { - } tFPGA_LED_IfaceConstants; - - virtual void writeFPGA_LED(bool value, tRioStatusCode *status) = 0; - virtual bool readFPGA_LED(tRioStatusCode *status) = 0; - - - typedef enum - { - } tRevision_IfaceConstants; - - virtual unsigned int readRevision(tRioStatusCode *status) = 0; - - - - -private: - tGlobal(const tGlobal&); - void operator=(const tGlobal&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Global_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tInterrupt.h b/hal/AthenaXX/src/main/native/ChipObject/tInterrupt.h deleted file mode 100644 index 519f6b319b..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tInterrupt.h +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Interrupt_h__ -#define __nFRC_2012_1_6_4_Interrupt_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tInterrupt -{ -public: - tInterrupt(){} - virtual ~tInterrupt(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tInterrupt* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 8, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned Source_Channel : 4; - unsigned Source_Module : 1; - unsigned Source_AnalogTrigger : 1; - unsigned RisingEdge : 1; - unsigned FallingEdge : 1; - unsigned WaitForAck : 1; -#else - unsigned WaitForAck : 1; - unsigned FallingEdge : 1; - unsigned RisingEdge : 1; - unsigned Source_AnalogTrigger : 1; - unsigned Source_Module : 1; - unsigned Source_Channel : 4; -#endif - }; - struct{ - unsigned value : 9; - }; - } tConfig; - - - typedef enum - { - } tTimeStamp_IfaceConstants; - - virtual unsigned int readTimeStamp(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_Source_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_Source_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_Source_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_RisingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_FallingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_WaitForAck(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_Source_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_Source_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_Source_AnalogTrigger(tRioStatusCode *status) = 0; - virtual bool readConfig_RisingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_FallingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_WaitForAck(tRioStatusCode *status) = 0; - - - - - -private: - tInterrupt(const tInterrupt&); - void operator=(const tInterrupt&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Interrupt_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tInterruptManager.h b/hal/AthenaXX/src/main/native/ChipObject/tInterruptManager.h deleted file mode 100644 index b8fb361845..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tInterruptManager.h +++ /dev/null @@ -1,61 +0,0 @@ -// Class for handling interrupts. -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tInterruptManager_h__ -#define __tInterruptManager_h__ - -#include "tSystem.h" - -namespace ni -{ - namespace dsc - { - namespace osdep - { - class CriticalSection; - } - } -} - -namespace nFPGA -{ - -typedef void (*tInterruptHandler)(uint32_t interruptAssertedMask, void *param); - -class tInterruptManager : public tSystem -{ -public: - tInterruptManager(uint32_t interruptMask, bool watcher, tRioStatusCode *status); - ~tInterruptManager(); - void registerHandler(tInterruptHandler handler, void *param, tRioStatusCode *status); - uint32_t watch(int32_t timeoutInMs, tRioStatusCode *status); - void enable(tRioStatusCode *status); - void disable(tRioStatusCode *status); - bool isEnabled(tRioStatusCode *status); -private: - class tInterruptThread; - friend class tInterruptThread; - void handler(); - static int handlerWrapper(tInterruptManager *pInterrupt); - - void acknowledge(tRioStatusCode *status); - void reserve(tRioStatusCode *status); - void unreserve(tRioStatusCode *status); - tInterruptHandler _handler; - uint32_t _interruptMask; - tInterruptThread *_thread; - NiFpga_IrqContext _rioContext; - bool _watcher; - bool _enabled; - void *_userParam; - - // maintain the interrupts that are already dealt with. - static uint32_t _globalInterruptMask; - static ni::dsc::osdep::CriticalSection *_globalInterruptMaskSemaphore; -}; - -} - - -#endif // __tInterruptManager_h__ - diff --git a/hal/AthenaXX/src/main/native/ChipObject/tSPI.h b/hal/AthenaXX/src/main/native/ChipObject/tSPI.h deleted file mode 100644 index c74ec9b558..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tSPI.h +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_SPI_h__ -#define __nFRC_2012_1_6_4_SPI_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tSPI -{ -public: - tSPI(){} - virtual ~tSPI(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tSPI* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned ReceivedDataOverflow : 1; - unsigned Idle : 1; -#else - unsigned Idle : 1; - unsigned ReceivedDataOverflow : 1; -#endif - }; - struct{ - unsigned value : 2; - }; - } tStatus; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned BusBitWidth : 8; - unsigned ClockHalfPeriodDelay : 8; - unsigned MSBfirst : 1; - unsigned DataOnFalling : 1; - unsigned LatchFirst : 1; - unsigned LatchLast : 1; - unsigned FramePolarity : 1; - unsigned WriteOnly : 1; - unsigned ClockPolarity : 1; -#else - unsigned ClockPolarity : 1; - unsigned WriteOnly : 1; - unsigned FramePolarity : 1; - unsigned LatchLast : 1; - unsigned LatchFirst : 1; - unsigned DataOnFalling : 1; - unsigned MSBfirst : 1; - unsigned ClockHalfPeriodDelay : 8; - unsigned BusBitWidth : 8; -#endif - }; - struct{ - unsigned value : 23; - }; - } tConfig; - typedef - union{ - struct{ -#ifdef __vxworks - unsigned SCLK_Channel : 4; - unsigned SCLK_Module : 1; - unsigned MOSI_Channel : 4; - unsigned MOSI_Module : 1; - unsigned MISO_Channel : 4; - unsigned MISO_Module : 1; - unsigned SS_Channel : 4; - unsigned SS_Module : 1; -#else - unsigned SS_Module : 1; - unsigned SS_Channel : 4; - unsigned MISO_Module : 1; - unsigned MISO_Channel : 4; - unsigned MOSI_Module : 1; - unsigned MOSI_Channel : 4; - unsigned SCLK_Module : 1; - unsigned SCLK_Channel : 4; -#endif - }; - struct{ - unsigned value : 20; - }; - } tChannels; - - - - typedef enum - { - } tStatus_IfaceConstants; - - virtual tStatus readStatus(tRioStatusCode *status) = 0; - virtual bool readStatus_ReceivedDataOverflow(tRioStatusCode *status) = 0; - virtual bool readStatus_Idle(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReceivedData_IfaceConstants; - - virtual unsigned int readReceivedData(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDataToLoad_IfaceConstants; - - virtual void writeDataToLoad(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readDataToLoad(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_BusBitWidth(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ClockHalfPeriodDelay(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_MSBfirst(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DataOnFalling(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_LatchFirst(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_LatchLast(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_FramePolarity(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_WriteOnly(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_ClockPolarity(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_BusBitWidth(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ClockHalfPeriodDelay(tRioStatusCode *status) = 0; - virtual bool readConfig_MSBfirst(tRioStatusCode *status) = 0; - virtual bool readConfig_DataOnFalling(tRioStatusCode *status) = 0; - virtual bool readConfig_LatchFirst(tRioStatusCode *status) = 0; - virtual bool readConfig_LatchLast(tRioStatusCode *status) = 0; - virtual bool readConfig_FramePolarity(tRioStatusCode *status) = 0; - virtual bool readConfig_WriteOnly(tRioStatusCode *status) = 0; - virtual bool readConfig_ClockPolarity(tRioStatusCode *status) = 0; - - - typedef enum - { - } tClearReceivedData_IfaceConstants; - - virtual void strobeClearReceivedData(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReceivedElements_IfaceConstants; - - virtual unsigned short readReceivedElements(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLoad_IfaceConstants; - - virtual void strobeLoad(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tChannels_IfaceConstants; - - virtual void writeChannels(tChannels value, tRioStatusCode *status) = 0; - virtual void writeChannels_SCLK_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_SCLK_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MOSI_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MOSI_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MISO_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MISO_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_SS_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_SS_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual tChannels readChannels(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SCLK_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SCLK_Module(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MOSI_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MOSI_Module(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MISO_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MISO_Module(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SS_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SS_Module(tRioStatusCode *status) = 0; - - - typedef enum - { - } tAvailableToLoad_IfaceConstants; - - virtual unsigned short readAvailableToLoad(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReadReceivedData_IfaceConstants; - - virtual void strobeReadReceivedData(tRioStatusCode *status) = 0; - - - - -private: - tSPI(const tSPI&); - void operator=(const tSPI&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_SPI_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tSolenoid.h b/hal/AthenaXX/src/main/native/ChipObject/tSolenoid.h deleted file mode 100644 index 67c9a40103..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tSolenoid.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Solenoid_h__ -#define __nFRC_2012_1_6_4_Solenoid_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tSolenoid -{ -public: - tSolenoid(){} - virtual ~tSolenoid(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tSolenoid* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - kNumDO7_0Elements = 2, - } tDO7_0_IfaceConstants; - - virtual void writeDO7_0(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readDO7_0(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - -private: - tSolenoid(const tSolenoid&); - void operator=(const tSolenoid&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Solenoid_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tSysWatchdog.h b/hal/AthenaXX/src/main/native/ChipObject/tSysWatchdog.h deleted file mode 100644 index daca9b6d0f..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tSysWatchdog.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_SysWatchdog_h__ -#define __nFRC_2012_1_6_4_SysWatchdog_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tSysWatchdog -{ -public: - tSysWatchdog(){} - virtual ~tSysWatchdog(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tSysWatchdog* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - } tCommand_IfaceConstants; - - virtual void writeCommand(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readCommand(tRioStatusCode *status) = 0; - - - typedef enum - { - } tChallenge_IfaceConstants; - - virtual unsigned char readChallenge(tRioStatusCode *status) = 0; - - - typedef enum - { - } tActive_IfaceConstants; - - virtual void writeActive(bool value, tRioStatusCode *status) = 0; - virtual bool readActive(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimer_IfaceConstants; - - virtual unsigned int readTimer(tRioStatusCode *status) = 0; - - - - -private: - tSysWatchdog(const tSysWatchdog&); - void operator=(const tSysWatchdog&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_SysWatchdog_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tSystem.h b/hal/AthenaXX/src/main/native/ChipObject/tSystem.h deleted file mode 100644 index baf83a8f88..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tSystem.h +++ /dev/null @@ -1,47 +0,0 @@ -// Base class for generated chip objects -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tSystem_h__ -#define __tSystem_h__ - -#include "NiFpga.h" -typedef NiFpga_Status tRioStatusCode; - -#define FRC_FPGA_PRELOAD_BITFILE - -typedef uint32_t NiFpga_Session; - -namespace nFPGA -{ - -class tSystem -{ -public: - tSystem(tRioStatusCode *status); - ~tSystem(); - void getFpgaGuid(uint32_t *guid_ptr, tRioStatusCode *status); - -protected: - static NiFpga_Session _DeviceHandle; - -#ifdef FRC_FPGA_PRELOAD_BITFILE - void NiFpga_SharedOpen_common(const char* bitfile); - NiFpga_Status NiFpga_SharedOpen(const char* bitfile, - const char* signature, - const char* resource, - uint32_t attribute, - NiFpga_Session* session); - NiFpga_Status NiFpgaLv_SharedOpen(const char* const bitfile, - const char* const apiSignature, - const char* const resource, - const uint32_t attribute, - NiFpga_Session* const session); -private: - static char *_FileName; - static char *_Bitfile; -#endif -}; - -} - -#endif // __tSystem_h__ diff --git a/hal/AthenaXX/src/main/native/ChipObject/tSystemInterface.h b/hal/AthenaXX/src/main/native/ChipObject/tSystemInterface.h deleted file mode 100644 index 46786e8e7d..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tSystemInterface.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tSystemInterface_h__ -#define __tSystemInterface_h__ - -namespace nFPGA -{ - -class tSystemInterface -{ -public: - tSystemInterface(){} - virtual ~tSystemInterface(){} - - virtual const uint16_t getExpectedFPGAVersion()=0; - virtual const uint32_t getExpectedFPGARevision()=0; - virtual const uint32_t * const getExpectedFPGASignature()=0; - virtual void getHardwareFpgaSignature(uint32_t *guid_ptr, tRioStatusCode *status)=0; - virtual uint32_t getLVHandle(tRioStatusCode *status)=0; - virtual uint32_t getHandle()=0; -}; - -} - -#endif // __tSystemInterface_h__ - diff --git a/hal/AthenaXX/src/main/native/ChipObject/tWatchdog.h b/hal/AthenaXX/src/main/native/ChipObject/tWatchdog.h deleted file mode 100644 index d4a4cba383..0000000000 --- a/hal/AthenaXX/src/main/native/ChipObject/tWatchdog.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Watchdog_h__ -#define __nFRC_2012_1_6_4_Watchdog_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tWatchdog -{ -public: - tWatchdog(){} - virtual ~tWatchdog(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tWatchdog* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ -#ifdef __vxworks - unsigned SystemActive : 1; - unsigned Alive : 1; - unsigned SysDisableCount : 15; - unsigned DisableCount : 15; -#else - unsigned DisableCount : 15; - unsigned SysDisableCount : 15; - unsigned Alive : 1; - unsigned SystemActive : 1; -#endif - }; - struct{ - unsigned value : 32; - }; - } tStatus; - - - - typedef enum - { - } tStatus_IfaceConstants; - - virtual tStatus readStatus(tRioStatusCode *status) = 0; - virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0; - virtual bool readStatus_Alive(tRioStatusCode *status) = 0; - virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0; - virtual unsigned short readStatus_DisableCount(tRioStatusCode *status) = 0; - - - typedef enum - { - } tKill_IfaceConstants; - - virtual void strobeKill(tRioStatusCode *status) = 0; - - - typedef enum - { - } tFeed_IfaceConstants; - - virtual void strobeFeed(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimer_IfaceConstants; - - virtual unsigned int readTimer(tRioStatusCode *status) = 0; - - - typedef enum - { - } tExpiration_IfaceConstants; - - virtual void writeExpiration(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readExpiration(tRioStatusCode *status) = 0; - - - typedef enum - { - } tImmortal_IfaceConstants; - - virtual void writeImmortal(bool value, tRioStatusCode *status) = 0; - virtual bool readImmortal(tRioStatusCode *status) = 0; - - - - -private: - tWatchdog(const tWatchdog&); - void operator=(const tWatchdog&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Watchdog_h__ diff --git a/hal/AthenaXX/src/main/native/Digital.cpp b/hal/AthenaXX/src/main/native/Digital.cpp deleted file mode 100644 index ae7095430a..0000000000 --- a/hal/AthenaXX/src/main/native/Digital.cpp +++ /dev/null @@ -1,1492 +0,0 @@ - -#include "HAL/Digital.h" - -#include "Port.h" -#include "HAL/HAL.h" -#include "ChipObject.h" -#include "HAL/cpp/Synchronized.h" -#include "HAL/cpp/Resource.h" -#include "NetworkCommunication/LoadOut.h" -#include -#include - -static const uint32_t kExpectedLoopTiming = 260; -static const uint32_t kDigitalPins = 14; -static const uint32_t kPwmPins = 10; -static const uint32_t kRelayPins = 8; -/** - * kDefaultPwmPeriod is in ms - * - * - 20ms periods (50 Hz) are the "safest" setting in that this works for all devices - * - 20ms periods seem to be desirable for Vex Motors - * - 20ms periods are the specified period for HS-322HD servos, but work reliably down - * to 10.0 ms; starting at about 8.5ms, the servo sometimes hums and get hot; - * by 5.0ms the hum is nearly continuous - * - 10ms periods work well for Victor 884 - * - 5ms periods allows higher update rates for Luminary Micro Jaguar speed controllers. - * Due to the shipping firmware on the Jaguar, we can't run the update period less - * than 5.05 ms. - * - * kDefaultPwmPeriod is the 1x period (5.05 ms). In hardware, the period scaling is implemented as an - * output squelch to get longer periods for old devices. - */ -static const float kDefaultPwmPeriod = 5.05; -/** - * kDefaultPwmCenter is the PWM range center in ms - */ -static const float kDefaultPwmCenter = 1.5; -/** - * kDefaultPWMStepsDown is the number of PWM steps below the centerpoint - */ -static const int32_t kDefaultPwmStepsDown = 128; -static const int32_t kPwmDisabled = 0; - -struct digital_port_t { - Port port; - tDIO *module; - uint32_t PWMGeneratorID; -}; -typedef struct digital_port_t DigitalPort; - -// XXX: Set these back to static once we figure out the memory clobbering issue -MUTEX_ID digitalDIOSemaphore = NULL; -MUTEX_ID digitalRelaySemaphore = NULL; -MUTEX_ID digitalPwmSemaphore = NULL; -MUTEX_ID digitalI2CSemaphore = NULL; -tDIO* digitalModules[2] = {NULL, NULL}; -Resource *DIOChannels = NULL; -Resource *DO_PWMGenerators[tDIO::kNumSystems] = {NULL}; - -bool digitalModulesInitialized = false; - -/** - * Initialize the digital modules. - */ -void initializeDigital(int32_t *status) { - if (digitalModulesInitialized) return; - - // Create a semaphore to protect changes to the digital output values - digitalDIOSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - // Create a semaphore to protect changes to the relay values - digitalRelaySemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - // Create a semaphore to protect changes to the DO PWM config - digitalPwmSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - digitalI2CSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - for (unsigned int i = 0; i < (sizeof(digitalModules)/sizeof(digitalModules[0])); i++) { - Resource::CreateResourceObject(&DIOChannels, tDIO::kNumSystems * kDigitalPins); - Resource::CreateResourceObject(&DO_PWMGenerators[i], tDIO::kNumDO_PWMDutyCycleElements); - digitalModules[i] = tDIO::create(i, status); - - // Make sure that the 9403 IONode has had a chance to initialize before continuing. - while(digitalModules[i]->readLoopTiming(status) == 0) delayTicks(1); - - if (digitalModules[i]->readLoopTiming(status) != kExpectedLoopTiming) { - // TODO: char err[128]; - // TODO: sprintf(err, "DIO LoopTiming: %d, expecting: %lu\n", digitalModules[port->module-1]->readLoopTiming(status), kExpectedLoopTiming); - *status = LOOP_TIMING_ERROR; // NOTE: Doesn't display the error - } - - //Calculate the length, in ms, of one DIO loop - double loopTime = digitalModules[i]->readLoopTiming(status)/(kSystemClockTicksPerMicrosecond*1e3); - - digitalModules[i]->writePWMConfig_Period((uint16_t) (kDefaultPwmPeriod/loopTime + .5), status); - digitalModules[i]->writePWMConfig_MinHigh((uint16_t) ((kDefaultPwmCenter-kDefaultPwmStepsDown*loopTime)/loopTime + .5), status); - - // Ensure that PWM output values are set to OFF - for (uint32_t pwm_index = 1; pwm_index <= kPwmPins; pwm_index++) { - // Initialize port structure - DigitalPort* digital_port = new DigitalPort(); - digital_port->port.pin = pwm_index; - digital_port->port.module = i + 1; - digital_port->module = digitalModules[i]; - - setPWM(digital_port, kPwmDisabled, status); - setPWMPeriodScale(digital_port, 3, status); // Set all to 4x by default. - } - - // Turn off all relay outputs. - digitalModules[i]->writeSlowValue_RelayFwd(0, status); - digitalModules[i]->writeSlowValue_RelayRev(0, status); - } - digitalModulesInitialized = true; -} - -/** - * Create a new instance of an digital module. - * Create an instance of the digital module object. Initialize all the parameters - * to reasonable values on start. - * Setting a global value on an digital module can be done only once unless subsequent - * values are set the previously set value. - * Digital modules are a singleton, so the constructor is never called outside of this class. - * - * @param moduleNumber The digital module to create (1 or 2). - */ -void* initializeDigitalPort(void* port_pointer, int32_t *status) { - initializeDigital(status); - Port* port = (Port*) port_pointer; - - // Initialize port structure - DigitalPort* digital_port = new DigitalPort(); - digital_port->port = *port; - digital_port->module = digitalModules[digital_port->port.module-1]; - - return digital_port; -} - -bool checkDigitalModule(uint8_t module) { - if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Digital, module - 1)) - return true; - return false; -} - -bool checkPWMChannel(void* digital_port_pointer) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - if (port->port.pin > 0 && port->port.pin <= kPwmPins) - return true; - return false; -} - -bool checkRelayChannel(void* digital_port_pointer) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - if (port->port.pin > 0 && port->port.pin <= kRelayPins) - return true; - return false; -} - -uint8_t remapDigitalChannel(uint32_t pin, int32_t *status) { - return 15 - pin; // TODO: Need channel validation -} - -uint8_t unmapDigitalChannel(uint32_t pin, int32_t *status) { - return 15 - pin; // TODO: Need channel validation -} - -/** - * Set a PWM channel to the desired value. The values range from 0 to 255 and the period is controlled - * by the PWM Period and MinHigh registers. - * - * @param channel The PWM channel to set. - * @param value The PWM value to set. - */ -void setPWM(void* digital_port_pointer, unsigned short value, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkPWMChannel(port); - port->module->writePWMValue(port->port.pin - 1, value, status); -} - -/** - * Get a value from a PWM channel. The values range from 0 to 255. - * - * @param channel The PWM channel to read from. - * @return The raw PWM value. - */ -unsigned short getPWM(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkPWMChannel(port); - return port->module->readPWMValue(port->port.pin - 1, status); -} - -/** - * Set how how often the PWM signal is squelched, thus scaling the period. - * - * @param channel The PWM channel to configure. - * @param squelchMask The 2-bit mask of outputs to squelch. - */ -void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkPWMChannel(port); - port->module->writePWMPeriodScale(port->port.pin - 1, squelchMask, status); -} - -/** - * Allocate a DO PWM Generator. - * Allocate PWM generators so that they are not accidently reused. - * - * @return PWM Generator refnum - */ -void* allocatePWM(int32_t *status) { - return allocatePWMWithModule(0, status); -} - -/** - * Allocate a DO PWM Generator. - * Allocate PWM generators so that they are not accidently reused. - * - * @return PWM Generator refnum - */ -void* allocatePWMWithModule(uint8_t module, int32_t *status) { - char buf[64]; - snprintf(buf, 64, "DO_PWM (Module: %d)", module); - uint32_t* val = NULL; - *val = DO_PWMGenerators[(module - 1)]->Allocate(buf); - return val; -} - -/** - * Free the resource associated with a DO PWM generator. - * - * @param pwmGenerator The pwmGen to free that was allocated with AllocateDO_PWM() - */ -void freePWM(void* pwmGenerator, int32_t *status) { - freePWMWithModule(0, pwmGenerator, status); -} - -/** - * Free the resource associated with a DO PWM generator. - * - * @param pwmGenerator The pwmGen to free that was allocated with AllocateDO_PWM() - */ -void freePWMWithModule(uint8_t module, void* pwmGenerator, int32_t *status) { - uint32_t id = *((uint32_t*) pwmGenerator); - if (id == ~0ul) return; - DO_PWMGenerators[(module - 1)]->Free(id); -} - -/** - * Change the frequency of the DO PWM generator. - * - * The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is logarithmic. - * - * @param rate The frequency to output all digital output PWM signals on this module. - */ -void setPWMRate(double rate, int32_t *status) { - setPWMRateWithModule(0, rate, status); -} - -/** - * Change the frequency of the DO PWM generator. - * - * The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is logarithmic. - * - * @param rate The frequency to output all digital output PWM signals on this module. - */ -void setPWMRateWithModule(uint8_t module, double rate, int32_t *status) { - // Currently rounding in the log rate domain... heavy weight toward picking a higher freq. - // TODO: Round in the linear rate domain. - uint8_t pwmPeriodPower = (uint8_t)(log(1.0 / (digitalModules[module-1]->readLoopTiming(status) * 0.25E-6 * rate))/log(2.0) + 0.5); - digitalModules[module-1]->writeDO_PWMConfig_PeriodPower(pwmPeriodPower, status); -} - -/** - * Configure the duty-cycle of the PWM generator - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param dutyCycle The percent duty cycle to output [0..1]. - */ -void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) { - setPWMDutyCycleWithModule(0, pwmGenerator, dutyCycle, status); -} - -/** - * Configure the duty-cycle of the PWM generator - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param dutyCycle The percent duty cycle to output [0..1]. - */ -void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCycle, int32_t *status) { - uint32_t id = *((uint32_t*) pwmGenerator); - if (id == ~0ul) return; - if (dutyCycle > 1.0) dutyCycle = 1.0; - if (dutyCycle < 0.0) dutyCycle = 0.0; - float rawDutyCycle = 256.0 * dutyCycle; - if (rawDutyCycle > 255.5) rawDutyCycle = 255.5; - { - Synchronized sync(digitalPwmSemaphore); - uint8_t pwmPeriodPower = digitalModules[module-1]->readDO_PWMConfig_PeriodPower(status); - if (pwmPeriodPower < 4) - { - // The resolution of the duty cycle drops close to the highest frequencies. - rawDutyCycle = rawDutyCycle / pow(2.0, 4 - pwmPeriodPower); - } - digitalModules[module-1]->writeDO_PWMDutyCycle(id, (uint8_t)rawDutyCycle, status); - } -} - -/** - * Configure which DO channel the PWM siganl is output on - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param channel The Digital Output channel to output on - */ -void setPWMOutputChannel(void* pwmGenerator, uint32_t pin, int32_t *status) { - setPWMOutputChannelWithModule(0, pwmGenerator, pin, status); -} - -/** - * Configure which DO channel the PWM siganl is output on - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param channel The Digital Output channel to output on - */ -void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t pin, int32_t *status) { - uint32_t id = *((uint32_t*) pwmGenerator); - if (id == ~0ul) return; - switch(id) { - case 0: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_0(remapDigitalChannel(pin - 1, status), status); - break; - case 1: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_1(remapDigitalChannel(pin - 1, status), status); - break; - case 2: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_2(remapDigitalChannel(pin - 1, status), status); - break; - case 3: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_3(remapDigitalChannel(pin - 1, status), status); - break; - } -} - -/** - * Set the state of a relay. - * Set the state of a relay output to be forward. Relays have two outputs and each is - * independently set to 0v or 12v. - */ -void setRelayForward(void* digital_port_pointer, bool on, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkRelayChannel(port); - { - Synchronized sync(digitalRelaySemaphore); - uint8_t forwardRelays = port->module->readSlowValue_RelayFwd(status); - if (on) - forwardRelays |= 1 << (port->port.pin - 1); - else - forwardRelays &= ~(1 << (port->port.pin - 1)); - port->module->writeSlowValue_RelayFwd(forwardRelays, status); - } -} - -/** - * Set the state of a relay. - * Set the state of a relay output to be reverse. Relays have two outputs and each is - * independently set to 0v or 12v. - */ -void setRelayReverse(void* digital_port_pointer, bool on, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkRelayChannel(port); - { - Synchronized sync(digitalRelaySemaphore); - uint8_t reverseRelays = port->module->readSlowValue_RelayRev(status); - if (on) - reverseRelays |= 1 << (port->port.pin - 1); - else - reverseRelays &= ~(1 << (port->port.pin - 1)); - port->module->writeSlowValue_RelayRev(reverseRelays, status); - } -} - -/** - * Get the current state of the forward relay channel - */ -bool getRelayForward(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint8_t forwardRelays = port->module->readSlowValue_RelayFwd(status); - return (forwardRelays & (1 << (port->port.pin - 1))) != 0; -} - -/** - * Get the current state of the reverse relay channel - */ -bool getRelayReverse(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint8_t reverseRelays = port->module->readSlowValue_RelayRev(status); - return (reverseRelays & (1 << (port->port.pin - 1))) != 0; -} - -/** - * Allocate Digital I/O channels. - * Allocate channels so that they are not accidently reused. Also the direction is set at the - * time of the allocation. - * - * @param channel The Digital I/O channel - * @param input If true open as input; if false open as output - * @return Was successfully allocated - */ -bool allocateDIO(void* digital_port_pointer, bool input, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - char buf[64]; - snprintf(buf, 64, "DIO %d (Module %d)", port->port.pin, port->port.module); - if (DIOChannels->Allocate(kDigitalPins * (port->port.module - 1) + port->port.pin - 1, buf) == ~0ul) return false; - { - Synchronized sync(digitalDIOSemaphore); - uint32_t bitToSet = 1 << (remapDigitalChannel(port->port.pin - 1, status)); - uint32_t outputEnable = port->module->readOutputEnable(status); - uint32_t outputEnableValue; - if (input) { - outputEnableValue = outputEnable & (~bitToSet); // clear the bit for read - } else { - outputEnableValue = outputEnable | bitToSet; // set the bit for write - } - port->module->writeOutputEnable(outputEnableValue, status); - } - return true; -} - -/** - * Free the resource associated with a digital I/O channel. - * - * @param channel The Digital I/O channel to free - */ -void freeDIO(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - DIOChannels->Free(kDigitalPins * (port->port.module - 1) + port->port.pin - 1); -} - -/** - * Write a digital I/O bit to the FPGA. - * Set a single value on a digital I/O channel. - * - * @param channel The Digital I/O channel - * @param value The state to set the digital channel (if it is configured as an output) - */ -void setDIO(void* digital_port_pointer, short value, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - if (value != 0 && value != 1) { - if (value != 0) - value = 1; - } - { - Synchronized sync(digitalDIOSemaphore); - uint16_t currentDIO = port->module->readDO(status); - if(value == 0) { - currentDIO = currentDIO & ~(1 << remapDigitalChannel(port->port.pin - 1, status)); - } else if (value == 1) { - currentDIO = currentDIO | (1 << remapDigitalChannel(port->port.pin - 1, status)); - } - port->module->writeDO(currentDIO, status); - } -} - -/** - * Read a digital I/O bit from the FPGA. - * Get a single value from a digital I/O channel. - * - * @param channel The digital I/O channel - * @return The state of the specified channel - */ -bool getDIO(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint32_t currentDIO = port->module->readDI(status); - - //Shift 00000001 over channel-1 places. - //AND it against the currentDIO - //if it == 0, then return false - //else return true - return ((currentDIO >> remapDigitalChannel(port->port.pin - 1, status)) & 1) != 0; -} - -/** - * Read the direction of a the Digital I/O lines - * A 1 bit means output and a 0 bit means input. - * - * @param channel The digital I/O channel - * @return The direction of the specified channel - */ -bool getDIODirection(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint32_t currentOutputEnable = port->module->readOutputEnable(status); - - //Shift 00000001 over port->port.pin-1 places. - //AND it against the currentOutputEnable - //if it == 0, then return false - //else return true - return ((currentOutputEnable >> remapDigitalChannel(port->port.pin - 1, status)) & 1) != 0; -} - -/** - * Generate a single pulse. - * Write a pulse to the specified digital output channel. There can only be a single pulse going at any time. - * - * @param channel The Digital Output channel that the pulse should be output on - * @param pulseLength The active length of the pulse (in seconds) - */ -void pulse(void* digital_port_pointer, double pulseLength, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint16_t mask = 1 << remapDigitalChannel(port->port.pin - 1, status); - port->module->writePulseLength((uint8_t)(1.0e9 * pulseLength / (port->module->readLoopTiming(status) * 25)), status); - port->module->writePulse(mask, status); -} - -/** - * Check a DIO line to see if it is currently generating a pulse. - * - * @return A pulse is in progress - */ -bool isPulsing(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint16_t mask = 1 << remapDigitalChannel(port->port.pin - 1, status); - uint16_t pulseRegister = port->module->readPulse(status); - return (pulseRegister & mask) != 0; -} - -/** - * Check if any DIO line is currently generating a pulse. - * - * @return A pulse on some line is in progress - */ -bool isAnyPulsing(int32_t *status) { - return isAnyPulsingWithModule(1, status) || isAnyPulsingWithModule(2, status); -} - -/** - * Check if any DIO line is currently generating a pulse. - * - * @return A pulse on some line is in progress - */ -bool isAnyPulsingWithModule(uint8_t module, int32_t *status) { - uint16_t pulseRegister = digitalModules[module-1]->readPulse(status); - return pulseRegister != 0; -} - - - -struct counter_t { - tCounter* counter; - uint32_t index; -}; -typedef struct counter_t Counter; - -static Resource *counters = NULL; - -void* initializeCounter(Mode mode, uint32_t *index, int32_t *status) { - Resource::CreateResourceObject(&counters, tCounter::kNumSystems); - *index = counters->Allocate("Counter"); - if (*index == ~0ul) { - *status = NO_AVAILABLE_RESOURCES; - return NULL; - } - Counter* counter = new Counter(); - counter->counter = tCounter::create(*index, status); - counter->counter->writeConfig_Mode(mode, status); - counter->counter->writeTimerConfig_AverageSize(1, status); - counter->index = *index; - return counter; -} - -void freeCounter(void* counter_pointer, int32_t *status) { - if (counter_pointer != NULL) { - Counter* counter = (Counter*) counter_pointer; - delete counter->counter; - counters->Free(counter->index); - } else { - *status = NULL_PARAMETER; - } -} - -void setCounterAverageSize(void* counter_pointer, int32_t size, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeTimerConfig_AverageSize(size, status); -} - -/** - * Set the source object that causes the counter to count up. - * Set the up counting DigitalSource. - */ -void setCounterUpSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin, - bool analogTrigger, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - - counter->counter->writeConfig_UpSource_Module(module, status); - counter->counter->writeConfig_UpSource_Channel(pin, status); - counter->counter->writeConfig_UpSource_AnalogTrigger(analogTrigger, status); - - if(counter->counter->readConfig_Mode(status) == kTwoPulse || - counter->counter->readConfig_Mode(status) == kExternalDirection) { - setCounterUpSourceEdge(counter_pointer, true, false, status); - } - counter->counter->strobeReset(status); -} - -/** - * Set the edge sensitivity on an up counting source. - * Set the up source to either detect rising edges or falling edges. - */ -void setCounterUpSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_UpRisingEdge(risingEdge, status); - counter->counter->writeConfig_UpFallingEdge(fallingEdge, status); -} - -/** - * Disable the up counting source to the counter. - */ -void clearCounterUpSource(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - bool state = counter->counter->readConfig_Enable(status); - counter->counter->writeConfig_Enable(false, status); - counter->counter->writeConfig_UpFallingEdge(false, status); - counter->counter->writeConfig_UpRisingEdge(false, status); - // Index 0 of digital is always 0. - counter->counter->writeConfig_UpSource_Channel(0, status); - counter->counter->writeConfig_UpSource_AnalogTrigger(false, status); - counter->counter->writeConfig_Enable(state, status); -} - -/** - * Set the source object that causes the counter to count down. - * Set the down counting DigitalSource. - */ -void setCounterDownSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin, - bool analogTrigger, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - unsigned char mode = counter->counter->readConfig_Mode(status); - if (mode != kTwoPulse && mode != kExternalDirection) { - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "Counter only supports DownSource in TwoPulse and ExternalDirection modes."); - *status = PARAMETER_OUT_OF_RANGE; - return; - } - counter->counter->writeConfig_DownSource_Module(module, status); - counter->counter->writeConfig_DownSource_Channel(pin, status); - counter->counter->writeConfig_DownSource_AnalogTrigger(analogTrigger, status); - - setCounterDownSourceEdge(counter_pointer, true, false, status); - counter->counter->strobeReset(status); -} - -/** - * Set the edge sensitivity on a down counting source. - * Set the down source to either detect rising edges or falling edges. - */ -void setCounterDownSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_DownRisingEdge(risingEdge, status); - counter->counter->writeConfig_DownFallingEdge(fallingEdge, status); -} - -/** - * Disable the down counting source to the counter. - */ -void clearCounterDownSource(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - bool state = counter->counter->readConfig_Enable(status); - counter->counter->writeConfig_Enable(false, status); - counter->counter->writeConfig_DownFallingEdge(false, status); - counter->counter->writeConfig_DownRisingEdge(false, status); - // Index 0 of digital is always 0. - counter->counter->writeConfig_DownSource_Channel(0, status); - counter->counter->writeConfig_DownSource_AnalogTrigger(false, status); - counter->counter->writeConfig_Enable(state, status); -} - -/** - * Set standard up / down counting mode on this counter. - * Up and down counts are sourced independently from two inputs. - */ -void setCounterUpDownMode(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kTwoPulse, status); -} - -/** - * Set external direction mode on this counter. - * Counts are sourced on the Up counter input. - * The Down counter input represents the direction to count. - */ -void setCounterExternalDirectionMode(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kExternalDirection, status); -} - -/** - * Set Semi-period mode on this counter. - * Counts up on both rising and falling edges. - */ -void setCounterSemiPeriodMode(void* counter_pointer, bool highSemiPeriod, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kSemiperiod, status); - counter->counter->writeConfig_UpRisingEdge(highSemiPeriod, status); - setCounterUpdateWhenEmpty(counter_pointer, false, status); -} - -/** - * Configure the counter to count in up or down based on the length of the input pulse. - * This mode is most useful for direction sensitive gear tooth sensors. - * @param threshold The pulse length beyond which the counter counts the opposite direction. Units are seconds. - */ -void setCounterPulseLengthMode(void* counter_pointer, double threshold, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kPulseLength, status); - counter->counter->writeConfig_PulseLengthThreshold((uint32_t)(threshold * 1.0e6) * kSystemClockTicksPerMicrosecond, status); -} - -/** - * Get the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @return SamplesToAverage The number of samples being averaged (from 1 to 127) - */ -int32_t getCounterSamplesToAverage(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - return counter->counter->readTimerConfig_AverageSize(status); -} - -/** - * Set the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @param samplesToAverage The number of samples to average from 1 to 127. - */ -void setCounterSamplesToAverage(void* counter_pointer, int samplesToAverage, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - if (samplesToAverage < 1 || samplesToAverage > 127) { - *status = PARAMETER_OUT_OF_RANGE; - } - counter->counter->writeTimerConfig_AverageSize(samplesToAverage, status); -} - -/** - * Start the Counter counting. - * This enables the counter and it starts accumulating counts from the associated - * input channel. The counter value is not reset on starting, and still has the previous value. - */ -void startCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Enable(1, status); -} - -/** - * Stop the Counter. - * Stops the counting but doesn't effect the current value. - */ -void stopCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Enable(0, status); -} - -/** - * Reset the Counter to zero. - * Set the counter value to zero. This doesn't effect the running state of the counter, just sets - * the current value to zero. - */ -void resetCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->strobeReset(status); -} - -/** - * Read the current counter value. - * Read the value at this instant. It may still be running, so it reflects the current value. Next - * time it is read, it might have a different value. - */ -int32_t getCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - int32_t value = counter->counter->readOutput_Value(status); - return value; -} - -/* - * Get the Period of the most recent count. - * Returns the time interval of the most recent count. This can be used for velocity calculations - * to determine shaft speed. - * @returns The period of the last two pulses in units of seconds. - */ -double getCounterPeriod(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - tCounter::tTimerOutput output = counter->counter->readTimerOutput(status); - double period; - if (output.Stalled) { - // Return infinity - double zero = 0.0; - period = 1.0 / zero; - } else { - // output.Period is a fixed point number that counts by 2 (24 bits, 25 integer bits) - period = (double)(output.Period << 1) / (double)output.Count; - } - return period * 1.0e-6; -} - -/** - * Set the maximum period where the device is still considered "moving". - * Sets the maximum period where the device is considered moving. This value is used to determine - * the "stopped" state of the counter using the GetStopped method. - * @param maxPeriod The maximum period where the counted device is considered moving in - * seconds. - */ -void setCounterMaxPeriod(void* counter_pointer, double maxPeriod, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeTimerConfig_StallPeriod((uint32_t)(maxPeriod * 1.0e6), status); -} - -/** - * Select whether you want to continue updating the event timer output when there are no samples captured. - * The output of the event timer has a buffer of periods that are averaged and posted to - * a register on the FPGA. When the timer detects that the event source has stopped - * (based on the MaxPeriod) the buffer of samples to be averaged is emptied. If you - * enable the update when empty, you will be notified of the stopped source and the event - * time will report 0 samples. If you disable update when empty, the most recent average - * will remain on the output until a new sample is acquired. You will never see 0 samples - * output (except when there have been no events since an FPGA reset) and you will likely not - * see the stopped bit become true (since it is updated at the end of an average and there are - * no samples to average). - */ -void setCounterUpdateWhenEmpty(void* counter_pointer, bool enabled, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeTimerConfig_UpdateWhenEmpty(enabled, status); -} - -/** - * Determine if the clock is stopped. - * Determine if the clocked input is stopped based on the MaxPeriod value set using the - * SetMaxPeriod method. If the clock exceeds the MaxPeriod, then the device (and counter) are - * assumed to be stopped and it returns true. - * @return Returns true if the most recent counter period exceeds the MaxPeriod value set by - * SetMaxPeriod. - */ -bool getCounterStopped(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - return counter->counter->readTimerOutput_Stalled(status); -} - -/** - * The last direction the counter value changed. - * @return The last direction the counter value changed. - */ -bool getCounterDirection(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - bool value = counter->counter->readOutput_Direction(status); - return value; -} - -/** - * Set the Counter to return reversed sensing on the direction. - * This allows counters to change the direction they are counting in the case of 1X and 2X - * quadrature encoding only. Any other counter mode isn't supported. - * @param reverseDirection true if the value counted should be negated. - */ -void setCounterReverseDirection(void* counter_pointer, bool reverseDirection, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - if (counter->counter->readConfig_Mode(status) == kExternalDirection) { - if (reverseDirection) - setCounterDownSourceEdge(counter_pointer, true, true, status); - else - setCounterDownSourceEdge(counter_pointer, false, true, status); - } -} - -struct encoder_t { - tEncoder* encoder; - uint32_t index; -}; -typedef struct encoder_t Encoder; - -static const double DECODING_SCALING_FACTOR = 0.25; -static Resource *quadEncoders = NULL; - -void* initializeEncoder(uint8_t port_a_module, uint32_t port_a_pin, bool port_a_analog_trigger, - uint8_t port_b_module, uint32_t port_b_pin, bool port_b_analog_trigger, - bool reverseDirection, int32_t *index, int32_t *status) { - - // Initialize encoder structure - Encoder* encoder = new Encoder(); - - Resource::CreateResourceObject(&quadEncoders, tEncoder::kNumSystems); - encoder->index = quadEncoders->Allocate("4X Encoder"); - *index = encoder->index; - // TODO: if (index == ~0ul) { CloneError(quadEncoders); return; } - encoder->encoder = tEncoder::create(encoder->index, status); - encoder->encoder->writeConfig_ASource_Module(port_a_module, status); - encoder->encoder->writeConfig_ASource_Channel(port_a_pin, status); - encoder->encoder->writeConfig_ASource_AnalogTrigger(port_a_analog_trigger, status); - encoder->encoder->writeConfig_BSource_Module(port_b_module, status); - encoder->encoder->writeConfig_BSource_Channel(port_b_pin, status); - encoder->encoder->writeConfig_BSource_AnalogTrigger(port_b_analog_trigger, status); - encoder->encoder->strobeReset(status); - encoder->encoder->writeConfig_Reverse(reverseDirection, status); - encoder->encoder->writeTimerConfig_AverageSize(4, status); - - return encoder; -} - -void freeEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - quadEncoders->Free(encoder->index); - delete encoder->encoder; -} - -/** - * Start the Encoder. - * Starts counting pulses on the Encoder device. - */ -void startEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeConfig_Enable(1, status); -} - -/** - * Stops counting pulses on the Encoder device. The value is not changed. - */ -void stopEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeConfig_Enable(0, status); -} - -/** - * Reset the Encoder distance to zero. - * Resets the current count to zero on the encoder. - */ -void resetEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->strobeReset(status); -} - -/** - * Gets the raw value from the encoder. - * The raw value is the actual count unscaled by the 1x, 2x, or 4x scale - * factor. - * @return Current raw count from the encoder - */ -int32_t getEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readOutput_Value(status); -} - -/** - * Returns the period of the most recent pulse. - * Returns the period of the most recent Encoder pulse in seconds. - * This method compenstates for the decoding type. - * - * @deprecated Use GetRate() in favor of this method. This returns unscaled periods and GetRate() scales using value from SetDistancePerPulse(). - * - * @return Period in seconds of the most recent pulse. - */ -double getEncoderPeriod(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - tEncoder::tTimerOutput output = encoder->encoder->readTimerOutput(status); - double value; - if (output.Stalled) { - // Return infinity - double zero = 0.0; - value = 1.0 / zero; - } else { - // output.Period is a fixed point number that counts by 2 (24 bits, 25 integer bits) - value = (double)(output.Period << 1) / (double)output.Count; - } - double measuredPeriod = value * 1.0e-6; - return measuredPeriod / DECODING_SCALING_FACTOR; -} - -/** - * Sets the maximum period for stopped detection. - * Sets the value that represents the maximum period of the Encoder before it will assume - * that the attached device is stopped. This timeout allows users to determine if the wheels or - * other shaft has stopped rotating. - * This method compensates for the decoding type. - * - * @deprecated Use SetMinRate() in favor of this method. This takes unscaled periods and SetMinRate() scales using value from SetDistancePerPulse(). - * - * @param maxPeriod The maximum time between rising and falling edges before the FPGA will - * report the device stopped. This is expressed in seconds. - */ -void setEncoderMaxPeriod(void* encoder_pointer, double maxPeriod, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeTimerConfig_StallPeriod((uint32_t)(maxPeriod * 1.0e6 * DECODING_SCALING_FACTOR), status); -} - -/** - * Determine if the encoder is stopped. - * Using the MaxPeriod value, a boolean is returned that is true if the encoder is considered - * stopped and false if it is still moving. A stopped encoder is one where the most recent pulse - * width exceeds the MaxPeriod. - * @return True if the encoder is considered stopped. - */ -bool getEncoderStopped(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readTimerOutput_Stalled(status) != 0; -} - -/** - * The last direction the encoder value changed. - * @return The last direction the encoder value changed. - */ -bool getEncoderDirection(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readOutput_Direction(status); -} - -/** - * Set the direction sensing for this encoder. - * This sets the direction sensing on the encoder so that it could count in the correct - * software direction regardless of the mounting. - * @param reverseDirection true if the encoder direction should be reversed - */ -void setEncoderReverseDirection(void* encoder_pointer, bool reverseDirection, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeConfig_Reverse(reverseDirection, status); -} - -/** - * Set the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @param samplesToAverage The number of samples to average from 1 to 127. - */ -void setEncoderSamplesToAverage(void* encoder_pointer, uint32_t samplesToAverage, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - if (samplesToAverage < 1 || samplesToAverage > 127) { - *status = PARAMETER_OUT_OF_RANGE; - } - encoder->encoder->writeTimerConfig_AverageSize(samplesToAverage, status); -} - -/** - * Get the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @return SamplesToAverage The number of samples being averaged (from 1 to 127) - */ -uint32_t getEncoderSamplesToAverage(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readTimerConfig_AverageSize(status); -} - -/** - * Get the loop timing of the Digital Module - * - * @return The loop time - */ -uint16_t getLoopTiming(int32_t *status) { - return getLoopTimingWithModule(1, status); -} - -/** - * Get the loop timing of the Digital Module - * - * @return The loop time - */ -uint16_t getLoopTimingWithModule(uint8_t module, int32_t *status) { - return digitalModules[module-1]->readLoopTiming(status); -} - - -struct spi_t { - tSPI* spi; - tSPI::tConfig config; - tSPI::tChannels channels; - MUTEX_ID semaphore; -}; -typedef struct spi_t SPI; - -void* initializeSPI(uint8_t sclk_routing_module, uint32_t sclk_routing_pin, - uint8_t mosi_routing_module, uint32_t mosi_routing_pin, - uint8_t miso_routing_module, uint32_t miso_routing_pin, int32_t *status) { - SPI* spi = new SPI(); - - spi->semaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - spi->spi = tSPI::create(status); - - spi->config.BusBitWidth = 8; - spi->config.ClockHalfPeriodDelay = 0; - spi->config.MSBfirst = 0; - spi->config.DataOnFalling = 0; - spi->config.LatchFirst = 0; - spi->config.LatchLast = 0; - spi->config.FramePolarity = 0; - spi->config.WriteOnly = miso_routing_pin ? 0 : 1; - spi->config.ClockPolarity = 0; - - spi->channels.SCLK_Channel = sclk_routing_pin; - spi->channels.SCLK_Module = sclk_routing_module; - spi->channels.SS_Channel = 0; - spi->channels.SS_Module = 0; - - if (mosi_routing_pin) { - spi->channels.MOSI_Channel = mosi_routing_pin; - spi->channels.MOSI_Module = mosi_routing_module; - } else { - spi->channels.MOSI_Channel = 0; - spi->channels.MOSI_Module = 0; - } - - if (miso_routing_pin) { - spi->channels.MISO_Channel = miso_routing_pin; - spi->channels.MISO_Module = miso_routing_module; - } else { - spi->channels.MISO_Channel = 0; - spi->channels.MISO_Module = 0; - } - return spi; -} - -void cleanSPI(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - delete spi->spi; - delete spi; -} - -/** - * Configure the number of bits from each word that the slave transmits - * or receives. - * - * @param bits The number of bits in one frame (1 to 32 bits). - */ -void setSPIBitsPerWord(void* spi_pointer, uint32_t bits, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.BusBitWidth = bits; -} - -/** - * Get the number of bits from each word that the slave transmits - * or receives. - * - * @return The number of bits in one frame (1 to 32 bits). - */ -uint32_t getSPIBitsPerWord(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - return spi->config.BusBitWidth; -} - -/** - * Configure the rate of the generated clock signal. - * The default and maximum value is 76,628.4 Hz. - * - * @param hz The clock rate in Hertz. - */ -void setSPIClockRate(void* spi_pointer, double hz, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - int delay = 0; - int loopTiming = getLoopTimingWithModule(spi->spi->readChannels_SCLK_Module(status), status); - double v = (1.0 / hz) / (2 * loopTiming / (kSystemClockTicksPerMicrosecond * 1e6)); - if (v < 1) { - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "SPI Clock too high"); - } - delay = (int) (v + .5); - if (delay > 255) { - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "SPI Clock too low"); - } - - spi->config.ClockHalfPeriodDelay = delay; -} - -/** - * Configure the order that bits are sent and received on the wire - * to be most significant bit first. - */ -void setSPIMSBFirst(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.MSBfirst = 1; -} - -/** - * Configure the order that bits are sent and received on the wire - * to be least significant bit first. - */ -void setSPILSBFirst(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.MSBfirst = 0; -} - -/** - * Configure that the data is stable on the falling edge and the data - * changes on the rising edge. - */ -void setSPISampleDataOnFalling(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.DataOnFalling = 1; -} - -/** - * Configure that the data is stable on the rising edge and the data - * changes on the falling edge. - */ -void setSPISampleDataOnRising(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.DataOnFalling = 0; -} - -void setSPISlaveSelect(void* spi_pointer, uint8_t ss_routing_module, uint32_t ss_routing_pin, - int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->channels.SS_Channel = ss_routing_pin; - spi->channels.SS_Module = ss_routing_module; -} - -void setSPILatchMode(void* spi_pointer, tFrameMode mode, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - switch (mode) { - case kChipSelect: - spi->config.LatchFirst = 0; - spi->config.LatchLast = 0; - break; - case kPreLatchPulse: - spi->config.LatchFirst = 1; - spi->config.LatchLast = 0; - break; - case kPostLatchPulse: - spi->config.LatchFirst = 0; - spi->config.LatchLast = 1; - break; - case kPreAndPostLatchPulse: - spi->config.LatchFirst = 1; - spi->config.LatchLast = 1; - break; - } -} - -tFrameMode getSPILatchMode(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - return (tFrameMode) (spi->config.LatchFirst | (spi->config.LatchLast << 1)); -} - -void setSPIFramePolarity(void* spi_pointer, bool activeLow, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.FramePolarity = activeLow ? 1 : 0; -} - -bool getSPIFramePolarity(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - return spi->config.FramePolarity != 0; -} - -/** - * Configure the clock output line to be active low. - * This is sometimes called clock polarity high. - */ -void setSPIClockActiveLow(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.ClockPolarity = 1; -} - -/** - * Configure the clock output line to be active high. - * This is sometimes called clock polarity low. - */ -void setSPIClockActiveHigh(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.ClockPolarity = 0; -} - - -/** - * Apply configuration settings and reset the SPI logic. - */ -void applySPIConfig(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - Synchronized sync(spi->semaphore); - - spi->spi->writeConfig(spi->config, status); - spi->spi->writeChannels(spi->channels, status); - spi->spi->strobeReset(status); -} - -/** - * Get the number of words that can currently be stored before being - * transmitted to the device. - * - * @return The number of words available to be written. - */ -uint16_t getSPIOutputFIFOAvailable(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - uint16_t result = spi->spi->readAvailableToLoad(status); - return result; -} - -/** - * Get the number of words received and currently available to be read from - * the receive FIFO. - * - * @return The number of words available to read. - */ -uint16_t getSPINumReceived(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - uint16_t result = spi->spi->readReceivedElements(status); - return result; -} - -/** - * Have all pending transfers completed? - * - * @return True if no transfers are pending. - */ -bool isSPIDone(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - bool result = spi->spi->readStatus_Idle(status); - return result; -} - - -/** - * Determine if the receive FIFO was full when attempting to add new data at - * end of a transfer. - * - * @return True if the receive FIFO overflowed. - */ -bool hadSPIReceiveOverflow(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - bool result = spi->spi->readStatus_ReceivedDataOverflow(status); - return result; -} - -/** - * Write a word to the slave device. Blocks until there is space in the - * output FIFO. - * - * If not running in output only mode, also saves the data received - * on the MISO input during the transfer into the receive FIFO. - */ -void writeSPI(void* spi_pointer, uint32_t data, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - if (spi->channels.MOSI_Channel == 0 && spi->channels.MOSI_Module == 0) { - *status = SPI_WRITE_NO_MOSI; - return; - } - - Synchronized sync(spi->semaphore); - - while (getSPIOutputFIFOAvailable(spi_pointer, status) == 0) - delayTicks(HAL_NO_WAIT); - - spi->spi->writeDataToLoad(data, status); - spi->spi->strobeLoad(status); -} - -/** - * Read a word from the receive FIFO. - * - * Waits for the current transfer to complete if the receive FIFO is empty. - * - * If the receive FIFO is empty, there is no active transfer, and initiate - * is false, errors. - * - * @param initiate If true, this function pushes "0" into the - * transmit buffer and initiates a transfer. - * If false, this function assumes that data is - * already in the receive FIFO from a previous write. - */ -uint32_t readSPI(void* spi_pointer, bool initiate, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - if (spi->channels.MISO_Channel == 0 && spi->channels.MISO_Module == 0) { - *status = SPI_READ_NO_MISO; - return 0; - } - - uint32_t data; - { - Synchronized sync(spi->semaphore); - - if (initiate) { - spi->spi->writeDataToLoad(0, status); - spi->spi->strobeLoad(status); - } - - // Do we have anything ready to read? - if (getSPINumReceived(spi_pointer, status) == 0) { - if (!initiate && isSPIDone(spi_pointer, status) - && getSPIOutputFIFOAvailable(spi_pointer, status) == kTransmitFIFODepth) { - // Nothing to read: error out - *status = SPI_READ_NO_DATA; - return 0; - } - - // Wait for the transaction to complete - while (getSPINumReceived(spi_pointer, status) == 0) - delayTicks(HAL_NO_WAIT); - } - - spi->spi->strobeReadReceivedData(status); - data = spi->spi->readReceivedData(status); - } - - return data; -} - -/** - * Stop any transfer in progress and empty the transmit FIFO. - */ -void resetSPI(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->spi->strobeReset(status); -} - -/** - * Empty the receive FIFO. - */ -void clearSPIReceivedData(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->spi->strobeClearReceivedData(status); -} - -/** - * Generic transaction. - * - * This is a lower-level interface to the I2C hardware giving you more control over each transaction. - * - * @param dataToSend Buffer of data to send as part of the transaction. - * @param sendSize Number of bytes to send as part of the transaction. [0..6] - * @param dataReceived Buffer to read data into. - * @param receiveSize Number of byted to read from the device. [0..7] - * @return Transfer Aborted... false for success, true for aborted. - */ -bool doI2CTransaction(uint8_t address, bool compatibilityMode, uint8_t *dataToSend, - uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize, - int32_t *status) { - return doI2CTransactionWithModule(1, address, compatibilityMode, dataToSend, sendSize, - dataReceived, receiveSize, status); -} - -/** - * Generic transaction. - * - * This is a lower-level interface to the I2C hardware giving you more control over each transaction. - * - * @param dataToSend Buffer of data to send as part of the transaction. - * @param sendSize Number of bytes to send as part of the transaction. [0..6] - * @param dataReceived Buffer to read data into. - * @param receiveSize Number of byted to read from the device. [0..7] - * @return Transfer Aborted... false for success, true for aborted. - */ -bool doI2CTransactionWithModule(uint8_t module, uint8_t address, bool compatibilityMode, - uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, - uint8_t receiveSize, int32_t *status) { - initializeDigital(status); - if (sendSize > 6) { - *status = PARAMETER_OUT_OF_RANGE; - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "sendSize"); - return true; - } - if (receiveSize > 7) { - *status = PARAMETER_OUT_OF_RANGE; - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "receiveSize"); - return true; - } - - uint32_t data=0; - uint32_t dataHigh=0; - uint32_t i; - for(i=0; iwriteI2CConfig_Address(address, status); - digitalModules[module]->writeI2CConfig_BytesToWrite(sendSize, status); - digitalModules[module]->writeI2CConfig_BytesToRead(receiveSize, status); - if (sendSize > 0) digitalModules[module]->writeI2CDataToSend(data, status); - if (sendSize > sizeof(data)) digitalModules[module]->writeI2CConfig_DataToSendHigh(dataHigh, status); - digitalModules[module]->writeI2CConfig_BitwiseHandshake(compatibilityMode, status); - uint8_t transaction = digitalModules[module]->readI2CStatus_Transaction(status); - digitalModules[module]->strobeI2CStart(status); - while(transaction == digitalModules[module]->readI2CStatus_Transaction(status)) delayTicks(1); - while(!digitalModules[module]->readI2CStatus_Done(status)) delayTicks(1); - aborted = digitalModules[module]->readI2CStatus_Aborted(status); - if (receiveSize > 0) data = digitalModules[module]->readI2CDataReceived(status); - if (receiveSize > sizeof(data)) dataHigh = digitalModules[module]->readI2CStatus_DataReceivedHigh(status); - } - - for(i=0; i> (8*i)) & 0xFF; - } - for(; i> (8*(i-sizeof(data)))) & 0xFF; - } - return aborted; -} diff --git a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/AICalibration.h b/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/AICalibration.h deleted file mode 100644 index 39755bda89..0000000000 --- a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/AICalibration.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef __AICalibration_h__ -#define __AICalibration_h__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - uint32_t FRC_NetworkCommunication_nAICalibration_getLSBWeight(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status); - int32_t FRC_NetworkCommunication_nAICalibration_getOffset(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status); - -#ifdef __cplusplus -} -#endif - -#endif // __AICalibration_h__ diff --git a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/FRCComm.h b/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/FRCComm.h deleted file mode 100644 index e971fac1a5..0000000000 --- a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/FRCComm.h +++ /dev/null @@ -1,193 +0,0 @@ -/************************************************************* - * NOTICE - * - * These are the only externally exposed functions to the - * NetworkCommunication library - * - * This is an implementation of FRC Spec for Comm Protocol - * Revision 4.5, June 30, 2008 - * - * Copyright (c) National Instruments 2008. All Rights Reserved. - * - *************************************************************/ - -#ifndef __FRC_COMM_H__ -#define __FRC_COMM_H__ - -#ifdef SIMULATION -#include -#define EXPORT_FUNC __declspec(dllexport) __cdecl -#else -#if defined(__vxworks) -#include -#define EXPORT_FUNC -#else -#include -#include -#define EXPORT_FUNC -#endif -#endif - -// Commandeer some bytes at the end for advanced I/O feedback. -#define IO_CONFIG_DATA_SIZE 32 -#define SYS_STATUS_DATA_SIZE 44 -#define USER_STATUS_DATA_SIZE (984 - IO_CONFIG_DATA_SIZE - SYS_STATUS_DATA_SIZE) -#define USER_DS_LCD_DATA_SIZE 128 - -struct FRCCommonControlData{ - uint16_t packetIndex; - union { - uint8_t control; -#ifndef __vxworks - struct { - uint8_t checkVersions :1; - uint8_t test :1; - uint8_t resync : 1; - uint8_t fmsAttached:1; - uint8_t autonomous : 1; - uint8_t enabled : 1; - uint8_t notEStop : 1; - uint8_t reset : 1; - }; -#else - struct { - uint8_t reset : 1; - uint8_t notEStop : 1; - uint8_t enabled : 1; - uint8_t autonomous : 1; - uint8_t fmsAttached:1; - uint8_t resync : 1; - uint8_t test :1; - uint8_t checkVersions :1; - }; -#endif - }; - uint8_t dsDigitalIn; - uint16_t teamID; - - char dsID_Alliance; - char dsID_Position; - - union { - int8_t stick0Axes[6]; - struct { - int8_t stick0Axis1; - int8_t stick0Axis2; - int8_t stick0Axis3; - int8_t stick0Axis4; - int8_t stick0Axis5; - int8_t stick0Axis6; - }; - }; - uint16_t stick0Buttons; // Left-most 4 bits are unused - - union { - int8_t stick1Axes[6]; - struct { - int8_t stick1Axis1; - int8_t stick1Axis2; - int8_t stick1Axis3; - int8_t stick1Axis4; - int8_t stick1Axis5; - int8_t stick1Axis6; - }; - }; - uint16_t stick1Buttons; // Left-most 4 bits are unused - - union { - int8_t stick2Axes[6]; - struct { - int8_t stick2Axis1; - int8_t stick2Axis2; - int8_t stick2Axis3; - int8_t stick2Axis4; - int8_t stick2Axis5; - int8_t stick2Axis6; - }; - }; - uint16_t stick2Buttons; // Left-most 4 bits are unused - - union { - int8_t stick3Axes[6]; - struct { - int8_t stick3Axis1; - int8_t stick3Axis2; - int8_t stick3Axis3; - int8_t stick3Axis4; - int8_t stick3Axis5; - int8_t stick3Axis6; - }; - }; - uint16_t stick3Buttons; // Left-most 4 bits are unused - - //Analog inputs are 10 bit right-justified - uint16_t analog1; - uint16_t analog2; - uint16_t analog3; - uint16_t analog4; - - uint64_t cRIOChecksum; - uint32_t FPGAChecksum0; - uint32_t FPGAChecksum1; - uint32_t FPGAChecksum2; - uint32_t FPGAChecksum3; - - char versionData[8]; -}; - -#define kFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Input 17 -#define kFRC_NetworkCommunication_DynamicType_DSEnhancedIO_Output 18 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Header 19 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Extra1 20 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Vertices1 21 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Extra2 22 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Vertices2 23 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Joystick 24 -#define kFRC_NetworkCommunication_DynamicType_Kinect_Custom 25 - -extern "C" { -#ifndef SIMULATION - void EXPORT_FUNC getFPGAHardwareVersion(uint16_t *fpgaVersion, uint32_t *fpgaRevision); -#endif - int EXPORT_FUNC getCommonControlData(FRCCommonControlData *data, int wait_ms); - int EXPORT_FUNC getRecentCommonControlData(FRCCommonControlData *commonData, int wait_ms); - int EXPORT_FUNC getRecentStatusData(uint8_t *batteryInt, uint8_t *batteryDec, uint8_t *dsDigitalOut, int wait_ms); - int EXPORT_FUNC getDynamicControlData(uint8_t type, char *dynamicData, int32_t maxLength, int wait_ms); - int EXPORT_FUNC setStatusData(float battery, uint8_t dsDigitalOut, uint8_t updateNumber, - const char *userDataHigh, int userDataHighLength, - const char *userDataLow, int userDataLowLength, int wait_ms); - int EXPORT_FUNC setStatusDataFloatAsInt(int battery, uint8_t dsDigitalOut, uint8_t updateNumber, - const char *userDataHigh, int userDataHighLength, - const char *userDataLow, int userDataLowLength, int wait_ms); - int EXPORT_FUNC setErrorData(const char *errors, int errorsLength, int wait_ms); - int EXPORT_FUNC setUserDsLcdData(const char *userDsLcdData, int userDsLcdDataLength, int wait_ms); - int EXPORT_FUNC overrideIOConfig(const char *ioConfig, int wait_ms); - -#ifdef SIMULATION - void EXPORT_FUNC setNewDataSem(HANDLE); -#else -# if defined (__vxworks) - void EXPORT_FUNC setNewDataSem(SEM_ID); - void EXPORT_FUNC setResyncSem(SEM_ID); -# else - void EXPORT_FUNC setNewDataSem(pthread_mutex_t *); - void EXPORT_FUNC setResyncSem(pthread_mutex_t *); -# endif - void EXPORT_FUNC signalResyncActionDone(void); -#endif - - // this uint32_t is really a LVRefNum - void EXPORT_FUNC setNewDataOccurRef(uint32_t refnum); -#ifndef SIMULATION - void EXPORT_FUNC setResyncOccurRef(uint32_t refnum); -#endif - - void EXPORT_FUNC FRC_NetworkCommunication_getVersionString(char *version); - void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramStarting(void); - void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramDisabled(void); - void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramAutonomous(void); - void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTeleop(void); - void EXPORT_FUNC FRC_NetworkCommunication_observeUserProgramTest(void); -}; - -#endif diff --git a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/LoadOut.h b/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/LoadOut.h deleted file mode 100644 index 0304b30665..0000000000 --- a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/LoadOut.h +++ /dev/null @@ -1,52 +0,0 @@ - -#ifndef __LoadOut_h__ -#define __LoadOut_h__ - -#ifdef SIMULATION -#include -#define EXPORT_FUNC __declspec(dllexport) __cdecl -#elif defined (__vxworks) -#include -#define EXPORT_FUNC -#else -#include -#define EXPORT_FUNC -#endif - -#define kMaxModuleNumber 2 -namespace nLoadOut -{ - typedef enum { - kModuleType_Unknown = 0x00, - kModuleType_Analog = 0x01, - kModuleType_Digital = 0x02, - kModuleType_Solenoid = 0x03, - } tModuleType; - bool EXPORT_FUNC getModulePresence(tModuleType moduleType, uint8_t moduleNumber); - typedef enum { - kTargetClass_Unknown = 0x00, - kTargetClass_FRC1 = 0x10, - kTargetClass_FRC2 = 0x20, - kTargetClass_FRC3 = 0x30, - kTargetClass_RoboRIO = 0x40, - kTargetClass_FRC2_Analog = kTargetClass_FRC2 | kModuleType_Analog, - kTargetClass_FRC2_Digital = kTargetClass_FRC2 | kModuleType_Digital, - kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | kModuleType_Solenoid, - kTargetClass_FamilyMask = 0xF0, - kTargetClass_ModuleMask = 0x0F, - } tTargetClass; - tTargetClass EXPORT_FUNC getTargetClass(); -} - -#ifdef __cplusplus -extern "C" { -#endif - - uint32_t EXPORT_FUNC FRC_NetworkCommunication_nLoadOut_getModulePresence(uint32_t moduleType, uint8_t moduleNumber); - uint32_t EXPORT_FUNC FRC_NetworkCommunication_nLoadOut_getTargetClass(); - -#ifdef __cplusplus -} -#endif - -#endif // __LoadOut_h__ diff --git a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/UsageReporting.h b/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/UsageReporting.h deleted file mode 100644 index 2c7499ea61..0000000000 --- a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/UsageReporting.h +++ /dev/null @@ -1,139 +0,0 @@ - -#ifndef __UsageReporting_h__ -#define __UsageReporting_h__ - -#ifdef SIMULATION -#include -#define EXPORT_FUNC __declspec(dllexport) __cdecl -#elif defined (__vxworks) -#include -#define EXPORT_FUNC -#else -#include -#include -#define EXPORT_FUNC -#endif - -#define kUsageReporting_version 1 - -namespace nUsageReporting -{ - typedef enum - { - kResourceType_Controller, - kResourceType_Module, - kResourceType_Language, - kResourceType_CANPlugin, - kResourceType_Accelerometer, - kResourceType_ADXL345, - kResourceType_AnalogChannel, - kResourceType_AnalogTrigger, - kResourceType_AnalogTriggerOutput, - kResourceType_CANJaguar, - kResourceType_Compressor, - kResourceType_Counter, - kResourceType_Dashboard, - kResourceType_DigitalInput, - kResourceType_DigitalOutput, - kResourceType_DriverStationCIO, - kResourceType_DriverStationEIO, - kResourceType_DriverStationLCD, - kResourceType_Encoder, - kResourceType_GearTooth, - kResourceType_Gyro, - kResourceType_I2C, - kResourceType_Framework, - kResourceType_Jaguar, - kResourceType_Joystick, - kResourceType_Kinect, - kResourceType_KinectStick, - kResourceType_PIDController, - kResourceType_Preferences, - kResourceType_PWM, - kResourceType_Relay, - kResourceType_RobotDrive, - kResourceType_SerialPort, - kResourceType_Servo, - kResourceType_Solenoid, - kResourceType_SPI, - kResourceType_Task, - kResourceType_Ultrasonic, - kResourceType_Victor, - kResourceType_Button, - kResourceType_Command, - kResourceType_AxisCamera, - kResourceType_PCVideoServer, - kResourceType_SmartDashboard, - kResourceType_Talon, - kResourceType_HiTechnicColorSensor, - kResourceType_HiTechnicAccel, - kResourceType_HiTechnicCompass, - kResourceType_SRF08, - } tResourceType; - - typedef enum - { - kLanguage_LabVIEW = 1, - kLanguage_CPlusPlus = 2, - kLanguage_Java = 3, - kLanguage_Python = 4, - - kCANPlugin_BlackJagBridge = 1, - kCANPlugin_2CAN = 2, - - kFramework_Iterative = 1, - kFramework_Simple = 2, - - kRobotDrive_ArcadeStandard = 1, - kRobotDrive_ArcadeButtonSpin = 2, - kRobotDrive_ArcadeRatioCurve = 3, - kRobotDrive_Tank = 4, - kRobotDrive_MecanumPolar = 5, - kRobotDrive_MecanumCartesian = 6, - - kDriverStationCIO_Analog = 1, - kDriverStationCIO_DigitalIn = 2, - kDriverStationCIO_DigitalOut = 3, - - kDriverStationEIO_Acceleration = 1, - kDriverStationEIO_AnalogIn = 2, - kDriverStationEIO_AnalogOut = 3, - kDriverStationEIO_Button = 4, - kDriverStationEIO_LED = 5, - kDriverStationEIO_DigitalIn = 6, - kDriverStationEIO_DigitalOut = 7, - kDriverStationEIO_FixedDigitalOut = 8, - kDriverStationEIO_PWM = 9, - kDriverStationEIO_Encoder = 10, - kDriverStationEIO_TouchSlider = 11, - - kADXL345_SPI = 1, - kADXL345_I2C = 2, - - kCommand_Scheduler = 1, - - kSmartDashboard_Instance = 1, - } tInstances; - - /** - * Report the usage of a resource of interest. - * - * @param resource one of the values in the tResourceType above (max value 51). - * @param instanceNumber an index that identifies the resource instance. - * @param context an optional additional context number for some cases (such as module number). Set to 0 to omit. - * @param feature a string to be included describing features in use on a specific resource. Setting the same resource more than once allows you to change the feature string. - */ - uint32_t EXPORT_FUNC report(tResourceType resource, uint8_t instanceNumber, uint8_t context = 0, const char *feature = NULL); -} - -#ifdef __cplusplus -extern "C" { -#endif - - uint32_t EXPORT_FUNC FRC_NetworkCommunication_nUsageReporting_report(uint8_t resource, uint8_t instanceNumber, uint8_t context, const char *feature); - -#ifdef __cplusplus -} -#endif - -#endif // __UsageReporting_h__ diff --git a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/environs.h b/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/environs.h deleted file mode 100644 index f3dad7f52d..0000000000 --- a/hal/AthenaXX/src/main/native/FRC_NetworkCommunication/environs.h +++ /dev/null @@ -1,94 +0,0 @@ -/*! - \file environs.h - \brief Defines export symbols and namespace aliases -*/ -/* - Copyright (c) 2013, - National Instruments Corporation. - All rights reserved. - - File: $Id: //lvaddon/FIRST/FRC/trunk/2015/tools/FRCNetworkCommunication/export/1.5/1.5.0a3/includes/FRC_NetworkCommunication/environs.h#1 $ - Author: nipg.pl - Originated: Wed Aug 28 16:07:10 2013 -*/ - -#ifndef ___FRC_NetworkCommunication_environs_h___ -#define ___FRC_NetworkCommunication_environs_h___ - -#include - -/* - * kFRC_NETWORKCOMMUNICATIONExportSymbols directs the build to export symbols modified by - * the kFRC_NETWORKCOMMUNICATIONExport keyword. kFRC_NETWORKCOMMUNICATIONNoExportSymbols directs the build to not - * import or export symbols modified by the kFRC_NETWORKCOMMUNICATIONExport keyword. If - * neither of these are defined, the symbols modified by kFRC_NETWORKCOMMUNICATIONExport are - * imported. These should be defined only when building the component, - * so clients do not need to trouble themselves with it. - */ -#if defined(kFRC_NETWORKCOMMUNICATIONExportSymbols) - #define kFRC_NETWORKCOMMUNICATIONExport kNIExport - #define kFRC_NETWORKCOMMUNICATIONExportPre kNIExportPre - #define kFRC_NETWORKCOMMUNICATIONExportPost kNIExportPost - #define kFRC_NETWORKCOMMUNICATIONExportInline kNIExportInline - #define kFRC_NETWORKCOMMUNICATIONExportData kNIExportData -#elif defined(kFRC_NETWORKCOMMUNICATIONNoExportSymbols) - #define kFRC_NETWORKCOMMUNICATIONExport - #define kFRC_NETWORKCOMMUNICATIONExportPre - #define kFRC_NETWORKCOMMUNICATIONExportPost - #define kFRC_NETWORKCOMMUNICATIONExportInline - #define kFRC_NETWORKCOMMUNICATIONExportData -#else - #define kFRC_NETWORKCOMMUNICATIONExport kNIImport - #define kFRC_NETWORKCOMMUNICATIONExportPre kNIImportPre - #define kFRC_NETWORKCOMMUNICATIONExportPost kNIImportPost - #define kFRC_NETWORKCOMMUNICATIONExportInline kNIImportInline - #define kFRC_NETWORKCOMMUNICATIONExportData kNIImportData -#endif - -// namespace declarations for aliasing ... - -#ifdef __cplusplus - -namespace nACE_STATIC_5_6 { } -namespace nCINTOOLS_1_2 { } -namespace nFRC_FPGA_CHIPOBJECT_1_2 { } -namespace nIAK_SHARED_13_0 { } -namespace nNIFPGA_13_0 { } -namespace nNI_EMB_6_0 { } -namespace nROBORIO_FRC_CHIPOBJECT_1_2 { } - -/*! - \namespace nFRC_NETWORKCOMMUNICATION_1_5 - \brief FRC Network Communication Release 1.5 -*/ -namespace nFRC_NETWORKCOMMUNICATION_1_5 -{ - // current versioned namespace aliases used by this package - - // FRC_FPGA_ChipObject 1.2: - namespace nFRC_FPGA_CHIPOBJECT = nFRC_FPGA_CHIPOBJECT_1_2; - - // RoboRIO_FRC_ChipObject 1.2: - namespace nROBORIO_FRC_CHIPOBJECT = nROBORIO_FRC_CHIPOBJECT_1_2; - - // ace_static 5.6: - namespace nACE_STATIC = nACE_STATIC_5_6; - - // cintools 1.2: - namespace nCINTOOLS = nCINTOOLS_1_2; - - // iak_shared 13.0: - namespace nIAK_SHARED = nIAK_SHARED_13_0; - - // ni_emb 6.0: - namespace nNI_EMB = nNI_EMB_6_0; - - // nifpga 13.0: - namespace nNIFPGA = nNIFPGA_13_0; - -} - -#endif // __cplusplus - -#endif // ___FRC_NetworkCommunication_environs_h___ - diff --git a/hal/AthenaXX/src/main/native/HAL.cpp b/hal/AthenaXX/src/main/native/HAL.cpp deleted file mode 100644 index 13f6704f26..0000000000 --- a/hal/AthenaXX/src/main/native/HAL.cpp +++ /dev/null @@ -1,122 +0,0 @@ - -#include "HAL/HAL.h" - -#include "Port.h" -#include "HAL/Errors.h" -#include "ChipObject.h" - -const uint32_t solenoid_kNumDO7_0Elements = tSolenoid::kNumDO7_0Elements; -const uint32_t dio_kNumSystems = tDIO::kNumSystems; -const uint32_t interrupt_kNumSystems = tInterrupt::kNumSystems; -const uint32_t kSystemClockTicksPerMicrosecond = 40; - -void* getPort(uint8_t pin) { - Port* port = new Port(); - port->pin = pin; - port->module = 1; - return port; -} - -/** - * @deprecated Uses module numbers - */ -void* getPortWithModule(uint8_t module, uint8_t pin) { - Port* port = new Port(); - port->pin = pin; - port->module = module; - return port; -} - -const char* getHALErrorMessage(int32_t code) { - if (code == 0) return ""; - else if (code == SAMPLE_RATE_TOO_HIGH) return SAMPLE_RATE_TOO_HIGH_MESSAGE; - else if (code == VOLTAGE_OUT_OF_RANGE) return VOLTAGE_OUT_OF_RANGE_MESSAGE; - else if (code == LOOP_TIMING_ERROR) return LOOP_TIMING_ERROR_MESSAGE; - else if (code == SPI_WRITE_NO_MOSI) return SPI_WRITE_NO_MOSI_MESSAGE; - else if (code == SPI_READ_NO_MISO) return SPI_READ_NO_MISO_MESSAGE; - else if (code == SPI_READ_NO_DATA) return SPI_READ_NO_DATA_MESSAGE; - else if (code == INCOMPATIBLE_STATE) return INCOMPATIBLE_STATE_MESSAGE; - else if (code == NO_AVAILABLE_RESOURCES) return NO_AVAILABLE_RESOURCES_MESSAGE; - else if (code == NULL_PARAMETER) return NULL_PARAMETER_MESSAGE; - else if (code == ANALOG_TRIGGER_LIMIT_ORDER_ERROR) return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE; - else if (code == ANALOG_TRIGGER_PULSE_OUTPUT_ERROR) return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE; - else if (code == PARAMETER_OUT_OF_RANGE) return PARAMETER_OUT_OF_RANGE_MESSAGE; - else return ""; -} - -/** - * Return the FPGA Version number. - * For now, expect this to be competition year. - * @return FPGA Version number. - */ -uint16_t getFPGAVersion(int32_t *status) { - tGlobal *global = tGlobal::create(status); - uint16_t version = global->readVersion(status); - delete global; - return version; -} - -/** - * Return the FPGA Revision number. - * The format of the revision is 3 numbers. - * The 12 most significant bits are the Major Revision. - * the next 8 bits are the Minor Revision. - * The 12 least significant bits are the Build Number. - * @return FPGA Revision number. - */ -uint32_t getFPGARevision(int32_t *status) { - tGlobal *global = tGlobal::create(status); - uint32_t revision = global->readRevision(status); - delete global; - return revision; -} - -/** - * Read the microsecond-resolution timer on the FPGA. - * - * @return The current time in microseconds according to the FPGA (since FPGA reset). - */ -uint32_t getFPGATime(int32_t *status) { - tGlobal *global = tGlobal::create(status); - uint32_t time = global->readLocalTime(status); - delete global; - return time; -} - - -/** - * Set the state of the FPGA status LED on the cRIO. - */ -void setFPGALED(uint32_t state, int32_t *status) { - tGlobal *global = tGlobal::create(status); - global->writeFPGA_LED(state, status); - delete global; -} - -/** - * Get the current state of the FPGA status LED on the cRIO. - * @return The curent state of the FPGA LED. - */ -int32_t getFPGALED(int32_t *status) { - tGlobal *global = tGlobal::create(status); - bool ledValue = global->readFPGA_LED(status); - delete global; - return ledValue; -} - -// TODO: HACKS -void NumericArrayResize() {} -void RTSetCleanupProc() {} -void EDVR_CreateReference() {} -void Occur() {} - -void imaqGetErrorText() {} -void imaqGetLastError() {} -void niTimestamp64() {} - -#include "NetworkCommunication/LoadOut.h" -namespace nLoadOut { - bool getModulePresence(tModuleType moduleType, uint8_t moduleNumber) { - return true; - } -} diff --git a/hal/AthenaXX/src/main/native/Interrupts.cpp b/hal/AthenaXX/src/main/native/Interrupts.cpp deleted file mode 100644 index c47f5769f4..0000000000 --- a/hal/AthenaXX/src/main/native/Interrupts.cpp +++ /dev/null @@ -1,86 +0,0 @@ - -#include "HAL/Interrupts.h" - -#include "ChipObject.h" - -struct interrupt_t { - tInterrupt *anInterrupt; - tInterruptManager *manager; -}; -typedef struct interrupt_t Interrupt; - -void* initializeInterrupts(uint32_t interruptIndex, bool watcher, int32_t *status) { - Interrupt* anInterrupt = new Interrupt(); - // Expects the calling leaf class to allocate an interrupt index. - anInterrupt->anInterrupt = tInterrupt::create(interruptIndex, status); - anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status); - anInterrupt->manager = new tInterruptManager(1 << interruptIndex, watcher, status); - return anInterrupt; -} - -void cleanInterrupts(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - delete anInterrupt->anInterrupt; - delete anInterrupt->manager; - anInterrupt->anInterrupt = NULL; - anInterrupt->manager = NULL; -} - -/** - * In synchronous mode, wait for the defined interrupt to occur. - * @param timeout Timeout in seconds - */ -void waitForInterrupt(void* interrupt_pointer, double timeout, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->watch((int32_t)(timeout * 1e3), status); -} - -/** - * Enable interrupts to occur on this input. - * oInterrupts are disabled when the RequestInterrupt call is made. This gives time to do the - * setup of the other options before starting to field interrupts. - */ -void enableInterrupts(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->enable(status); -} - -/** - * Disable Interrupts without without deallocating structures. - */ -void disableInterrupts(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->disable(status); -} - -/** - * Return the timestamp for the interrupt that occurred most recently. - * This is in the same time domain as GetClock(). - * @return Timestamp in seconds since boot. - */ -double readInterruptTimestamp(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - uint32_t timestamp = anInterrupt->anInterrupt->readTimeStamp(status); - return timestamp * 1e-6; -} - -void requestInterrupts(void* interrupt_pointer, uint8_t routing_module, uint32_t routing_pin, - bool routing_analog_trigger, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status); - anInterrupt->anInterrupt->writeConfig_Source_AnalogTrigger(routing_analog_trigger, status); - anInterrupt->anInterrupt->writeConfig_Source_Channel(routing_pin, status); - anInterrupt->anInterrupt->writeConfig_Source_Module(routing_module, status); -} - -void attachInterruptHandler(void* interrupt_pointer, InterruptHandlerFunction handler, - void* param, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->registerHandler(handler, param, status); -} - -void setInterruptUpSourceEdge(void* interrupt_pointer, bool risingEdge, bool fallingEdge, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->anInterrupt->writeConfig_RisingEdge(risingEdge, status); - anInterrupt->anInterrupt->writeConfig_FallingEdge(fallingEdge, status); -} diff --git a/hal/AthenaXX/src/main/native/NetworkCommunication/AICalibration.h b/hal/AthenaXX/src/main/native/NetworkCommunication/AICalibration.h deleted file mode 100644 index 39755bda89..0000000000 --- a/hal/AthenaXX/src/main/native/NetworkCommunication/AICalibration.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef __AICalibration_h__ -#define __AICalibration_h__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - uint32_t FRC_NetworkCommunication_nAICalibration_getLSBWeight(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status); - int32_t FRC_NetworkCommunication_nAICalibration_getOffset(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status); - -#ifdef __cplusplus -} -#endif - -#endif // __AICalibration_h__ diff --git a/hal/AthenaXX/src/main/native/NetworkCommunication/LoadOut.h b/hal/AthenaXX/src/main/native/NetworkCommunication/LoadOut.h deleted file mode 100644 index f28249e3f1..0000000000 --- a/hal/AthenaXX/src/main/native/NetworkCommunication/LoadOut.h +++ /dev/null @@ -1,39 +0,0 @@ - -#ifndef __LoadOut_h__ -#define __LoadOut_h__ - -#define kMaxModuleNumber 2 -namespace nLoadOut -{ - typedef enum { - kModuleType_Unknown = 0x00, - kModuleType_Analog = 0x01, - kModuleType_Digital = 0x02, - kModuleType_Solenoid = 0x03, - } tModuleType; - bool getModulePresence(tModuleType moduleType, uint8_t moduleNumber); - typedef enum { - kTargetClass_Unknown = 0x00, - kTargetClass_FRC1 = 0x10, - kTargetClass_FRC2 = 0x20, - kTargetClass_FRC2_Analog = kTargetClass_FRC2 | kModuleType_Analog, - kTargetClass_FRC2_Digital = kTargetClass_FRC2 | kModuleType_Digital, - kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | kModuleType_Solenoid, - kTargetClass_FamilyMask = 0xF0, - kTargetClass_ModuleMask = 0x0F, - } tTargetClass; - tTargetClass getTargetClass(); -} - -#ifdef __cplusplus -extern "C" { -#endif - - uint32_t FRC_NetworkCommunication_nLoadOut_getModulePresence(uint32_t moduleType, uint8_t moduleNumber); - uint32_t FRC_NetworkCommunication_nLoadOut_getTargetClass(); - -#ifdef __cplusplus -} -#endif - -#endif // __LoadOut_h__ diff --git a/hal/AthenaXX/src/main/native/Notifier.cpp b/hal/AthenaXX/src/main/native/Notifier.cpp deleted file mode 100644 index 8d9766b6c3..0000000000 --- a/hal/AthenaXX/src/main/native/Notifier.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -#include "HAL/Notifier.h" - -#include "ChipObject.h" - -static const uint32_t kTimerInterruptNumber = 28; - -struct notifier_t { - tAlarm *alarm; - tInterruptManager *manager; -}; -typedef struct notifier_t Notifier; - -void* initializeNotifier(void (*ProcessQueue)(uint32_t, void*), int32_t *status) { - Notifier* notifier = new Notifier(); - notifier->manager = new tInterruptManager(1 << kTimerInterruptNumber, false, status); - notifier->manager->registerHandler(ProcessQueue, NULL, status); - notifier->manager->enable(status); - notifier->alarm = tAlarm::create(status); - return notifier; -} - -void cleanNotifier(void* notifier_pointer, int32_t *status) { - Notifier* notifier = (Notifier*) notifier_pointer; - notifier->alarm->writeEnable(false, status); - delete notifier->alarm; - notifier->alarm = NULL; - notifier->manager->disable(status); - delete notifier->manager; - notifier->manager = NULL; -} - - -void updateNotifierAlarm(void* notifier_pointer, uint32_t triggerTime, int32_t *status) { - Notifier* notifier = (Notifier*) notifier_pointer; - // write the first item in the queue into the trigger time - notifier->alarm->writeTriggerTime(triggerTime, status); - // Enable the alarm. The hardware disables itself after each alarm. - notifier->alarm->writeEnable(true, status); -} diff --git a/hal/AthenaXX/src/main/native/Port.h b/hal/AthenaXX/src/main/native/Port.h deleted file mode 100644 index 433f318e92..0000000000 --- a/hal/AthenaXX/src/main/native/Port.h +++ /dev/null @@ -1,11 +0,0 @@ - -#ifndef HAL_PORT_H -#define HAL_PORT_H - -struct port_t { - uint8_t pin; - uint8_t module; -}; -typedef struct port_t Port; - -#endif diff --git a/hal/AthenaXX/src/main/native/Semaphore.cpp b/hal/AthenaXX/src/main/native/Semaphore.cpp deleted file mode 100644 index 2cf2258216..0000000000 --- a/hal/AthenaXX/src/main/native/Semaphore.cpp +++ /dev/null @@ -1,120 +0,0 @@ - -#include "HAL/Semaphore.h" - -#include "ChipObject.h" - -// See: http://www.vxdev.com/docs/vx55man/vxworks/ref/semMLib.html -const uint32_t SEMAPHORE_Q_FIFO= 0x01; // TODO: Support -const uint32_t SEMAPHORE_Q_PRIORITY = 0x01; // TODO: Support -const uint32_t SEMAPHORE_DELETE_SAFE = 0x04; // TODO: Support -const uint32_t SEMAPHORE_INVERSION_SAFE = 0x08; // TODO: Support - -const int32_t SEMAPHORE_NO_WAIT = 0; -const int32_t SEMAPHORE_WAIT_FOREVER = -1; - -const uint32_t SEMAPHORE_EMPTY = 0; -const uint32_t SEMAPHORE_FULL = 1; - -MUTEX_ID initializeMutex(uint32_t flags) { - pthread_mutexattr_t attr; - pthread_mutexattr_init(&attr); - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); - MUTEX_ID sem = new pthread_mutex_t(); - pthread_mutex_init(sem, &attr); - pthread_mutexattr_destroy(&attr); - return sem; -} - -void deleteMutex(MUTEX_ID sem) { - pthread_mutex_destroy(sem); - delete sem; -} - -/** - * Lock the semaphore, blocking until it's available. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t takeMutex(MUTEX_ID sem, int32_t timeout) { - if (timeout == SEMAPHORE_NO_WAIT) { - return pthread_mutex_trylock(sem); - } else if (timeout == SEMAPHORE_WAIT_FOREVER) { - return pthread_mutex_lock(sem); - } else { - // struct timespec test; - // return pthread_mutex_timedlock(sem, ); - return -1; // TODO: implement timed wait - } -} - -/** - * Unlock the semaphore. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t giveMutex(MUTEX_ID sem) { - // return semGive(sem); - // return sem_post(sem); - return pthread_mutex_unlock(sem); -} - -SEMAPHORE_ID initializeSemaphore(uint32_t flags, uint32_t initial_value) { - SEMAPHORE_ID sem = new sem_t; - sem_init(sem, 0, initial_value); - return sem; -} - -void deleteSemaphore(SEMAPHORE_ID sem) { - sem_destroy(sem); - delete sem; -} - -/** - * Lock the semaphore, blocking until it's available. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t takeSemaphore(SEMAPHORE_ID sem, int32_t timeout) { - if (timeout == SEMAPHORE_NO_WAIT) { - return sem_trywait(sem); - } else if (timeout == SEMAPHORE_WAIT_FOREVER) { - return sem_wait(sem); - } else { - // return sem_timedwait(sem, ); - return -1; // TODO: implement timed wait - } -} - -/** - * Unlock the semaphore. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t giveSemaphore(SEMAPHORE_ID sem) { - return sem_post(sem); -} - - -MULTIWAIT_ID initializeMultiWait() { - pthread_condattr_t attr; - pthread_condattr_init(&attr); - MULTIWAIT_ID cond = new pthread_cond_t(); - pthread_cond_init(cond, &attr); - pthread_condattr_destroy(&attr); - return cond; -} - -void deleteMultiWait(MULTIWAIT_ID sem) { - pthread_cond_destroy(sem); - delete sem; -} - -int8_t takeMultiWait(MULTIWAIT_ID sem, int32_t timeout) { - MUTEX_ID m = initializeMutex(NULL); - takeMutex(m, SEMAPHORE_WAIT_FOREVER); - int8_t val = pthread_cond_wait(sem, m); - deleteMutex(m); - return val; -} - -int8_t giveMultiWait(MULTIWAIT_ID sem) { - return pthread_cond_broadcast(sem); -} - - diff --git a/hal/AthenaXX/src/main/native/Solenoid.cpp b/hal/AthenaXX/src/main/native/Solenoid.cpp deleted file mode 100644 index 6dc822ed73..0000000000 --- a/hal/AthenaXX/src/main/native/Solenoid.cpp +++ /dev/null @@ -1,73 +0,0 @@ - -#include "HAL/Solenoid.h" - -#include "Port.h" -#include "HAL/Errors.h" -#include "ChipObject.h" -#include "HAL/cpp/Synchronized.h" -#include "NetworkCommunication/LoadOut.h" - -struct solenoid_port_t { - Port port; - tSolenoid *module; - uint32_t PWMGeneratorID; -}; -typedef struct solenoid_port_t SolenoidPort; - -static ReentrantSemaphore solenoidSemaphore; -static tSolenoid* solenoidModules[2] = {NULL, NULL}; - -bool solenoidModulesInitialized = false; - -/** - * Initialize the digital modules. - */ -void initializeSolenoid(int32_t *status) { - if (solenoidModulesInitialized) return; - - for (unsigned int i = 0; i < (sizeof(solenoidModules)/sizeof(solenoidModules[0])); i++) { - Synchronized sync(solenoidSemaphore); - solenoidModules[i] = tSolenoid::create(status); - } - solenoidModulesInitialized = true; -} - -void* initializeSolenoidPort(void* port_pointer, int32_t *status) { - initializeSolenoid(status); - Port* port = (Port*) port_pointer; - - // Initialize port structure - SolenoidPort* solenoid_port = new SolenoidPort(); - solenoid_port->port = *port; - solenoid_port->module = solenoidModules[solenoid_port->port.module-1]; - - return solenoid_port; -} - -bool checkSolenoidModule(uint8_t module) { - if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Solenoid, module - 1)) - return true; - return false; -} - -bool getSolenoid(void* solenoid_port_pointer, int32_t *status) { - SolenoidPort* port = (SolenoidPort*) solenoid_port_pointer; - if (checkSolenoidModule(port->port.module)) { - uint8_t mask = 1 << (port->port.pin - 1); - return (mask & port->module->readDO7_0(port->port.module - 1, status)); - } - return false; -} - -void setSolenoid(void* solenoid_port_pointer, bool value, int32_t *status) { - SolenoidPort* port = (SolenoidPort*) solenoid_port_pointer; - if (checkSolenoidModule(port->port.module)) { - Synchronized sync(solenoidSemaphore); - uint8_t currentValue = port->module->readDO7_0(port->port.module - 1, status); - uint8_t mask = 1 << (port->port.pin - 1); - if (value) currentValue = currentValue | mask; // Flip the bit on - else currentValue = currentValue & ~mask; // Flip the bit off - port->module->writeDO7_0(port->port.module - 1, currentValue, status); - } -} - diff --git a/hal/AthenaXX/src/main/native/Task.cpp b/hal/AthenaXX/src/main/native/Task.cpp deleted file mode 100644 index 22fc93743e..0000000000 --- a/hal/AthenaXX/src/main/native/Task.cpp +++ /dev/null @@ -1,100 +0,0 @@ - -#include "HAL/Task.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" - -#include -#include - -const uint32_t VXWORKS_FP_TASK = 0x01000000; -const int32_t HAL_objLib_OBJ_ID_ERROR = -1; // TODO: update to relevant TaskIDError -const int32_t HAL_objLib_OBJ_DELETED = -1; // TODO: update to relevant TaskDeletedError -const int32_t HAL_taskLib_ILLEGAL_OPTIONS = -1; // TODO: update to relevant TaskOptionsError -const int32_t HAL_memLib_NOT_ENOUGH_MEMORY = -1; // TODO: update to relevant TaskMemoryError -const int32_t HAL_taskLib_ILLEGAL_PRIORITY = -1; // TODO: update to relevant TaskPriorityError - -typedef struct task_args_t { - FUNCPTR fun; - char* name; - pthread_t** task; - uint32_t arg0, arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8, arg9; -} TaskArgs; - -void* startRoutine(void* data) { - TaskArgs* args = (TaskArgs*) data; - printf("[HAL] Starting task %s...\n", args->name); - int val = args->fun(args->arg0, args->arg1, args->arg2, args->arg3, args->arg4, - args->arg5, args->arg6, args->arg7, args->arg8, args->arg9); - printf("[HAL] Exited task %s with code %i\n", args->name, val); - *args->task = NULL; - int* ret = new int(); *ret = val; - return ret; -} - -TASK spawnTask(char * name, int priority, int options, int stackSize, - FUNCPTR entryPt, uint32_t arg0, uint32_t arg1, uint32_t arg2, - uint32_t arg3, uint32_t arg4, uint32_t arg5, uint32_t arg6, - uint32_t arg7, uint32_t arg8, uint32_t arg9) { - printf("[HAL] Spawning task %s...\n", name); - pthread_t* task = new pthread_t; - pthread_attr_t* attr = new pthread_attr_t; - pthread_attr_init(attr); - TaskArgs* args = new TaskArgs(); - args->fun = entryPt; - args->name = name; - args->task = new pthread_t*; - *args->task = task; - args->arg0 = arg0; args->arg1 = arg1; args->arg2 = arg2; args->arg3 = arg3; args->arg4 = arg4; - args->arg5 = arg5; args->arg6 = arg6; args->arg7 = arg7; args->arg8 = arg8; args->arg9 = arg9; - if (pthread_create(task, attr, startRoutine, args) == 0) { - printf("[HAL] Success\n"); - pthread_detach(*task); - } else { - printf("[HAL] Failure\n"); - task = NULL; - } - pthread_attr_destroy(attr); - return task; -} - -STATUS restartTask(TASK task) { - return ERROR; // TODO: implement; -} - -STATUS deleteTask(TASK task) { - return ERROR; // TODO: implement -} - -STATUS isTaskReady(TASK task) { - return ERROR; // TODO: implement -} - -STATUS isTaskSuspended(TASK task) { - return ERROR; // TODO: implement -} - -STATUS suspendTask(TASK task) { - return ERROR; // TODO: implement -} - -STATUS resumeTask(TASK task) { - return ERROR; // TODO: implement -} - -STATUS verifyTaskID(TASK task) { - if (task != NULL && pthread_kill(*task, 0) == 0) { - return OK; - } else { - return ERROR; - } -} - -STATUS setTaskPriority(TASK task, int priority) { - return ERROR; // TODO: implement -} - -STATUS getTaskPriority(TASK task, int* priority) { - return ERROR; // TODO: implement -} diff --git a/hal/AthenaXX/src/main/native/Utilities.cpp b/hal/AthenaXX/src/main/native/Utilities.cpp deleted file mode 100644 index b6aa8fc873..0000000000 --- a/hal/AthenaXX/src/main/native/Utilities.cpp +++ /dev/null @@ -1,29 +0,0 @@ - -#include "HAL/Utilities.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" - -const int32_t HAL_NO_WAIT = 0; -const int32_t HAL_WAIT_FOREVER = -1; - -void delayTicks(int32_t ticks) { - struct timespec test, remaining; - test.tv_sec = 0; - test.tv_nsec = ticks * 3; - nanosleep(&test, &remaining); -} - -void delayMillis(double ms) { - struct timespec test, remaining; - test.tv_sec = ms/1000; - test.tv_nsec = 1000*(((uint64_t) ms)%1000000); - nanosleep(&test, &remaining); -} - -void delaySeconds(double s) { - struct timespec test, remaining; - test.tv_sec = s; - test.tv_nsec = 0; - nanosleep(&test, &remaining); -} diff --git a/hal/AthenaXX/src/main/native/Watchdog.cpp b/hal/AthenaXX/src/main/native/Watchdog.cpp deleted file mode 100644 index 59e2041ab3..0000000000 --- a/hal/AthenaXX/src/main/native/Watchdog.cpp +++ /dev/null @@ -1,140 +0,0 @@ - -#include "HAL/Watchdog.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" - -typedef tWatchdog Watchdog; -const double kDefaultWatchdogExpiration = 0.5; - -void* initializeWatchdog(int32_t *status) { - Watchdog* watchdog = tWatchdog::create(status); - setWatchdogExpiration(watchdog, kDefaultWatchdogExpiration, status); - setWatchdogEnabled(watchdog, true, status); - return watchdog; -} - -void cleanWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - setWatchdogEnabled(watchdog, false, status); - delete watchdog; -} - -/** - * Throw the dog a bone. - * - * When everything is going well, you feed your dog when you get home. - * Let's hope you don't drive your car off a bridge on the way home... - * Your dog won't get fed and he will starve to death. - * - * By the way, it's not cool to ask the neighbor (some random task) to - * feed your dog for you. He's your responsibility! - * - * @returns Returns the previous state of the watchdog before feeding it. - */ -bool feedWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool previous = getWatchdogEnabled(watchdog_pointer, status); - watchdog->strobeFeed(status); - return previous; -} - -/** - * Put the watchdog out of its misery. - * - * Don't wait for your dying robot to starve when there is a problem. - * Kill it quickly, cleanly, and humanely. - */ -void killWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->strobeKill(status); -} - -/** - * Read how long it has been since the watchdog was last fed. - * - * @return The number of seconds since last meal. - */ -double getWatchdogLastFed(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - uint32_t timer = watchdog->readTimer(status); - return timer / (kSystemClockTicksPerMicrosecond * 1e6); -} - -/** - * Read what the current expiration is. - * - * @return The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -double getWatchdogExpiration(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - uint32_t expiration = watchdog->readExpiration(status); - return expiration / (kSystemClockTicksPerMicrosecond * 1e6); -} - -/** - * Configure how many seconds your watchdog can be neglected before it starves to death. - * - * @param expiration The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -void setWatchdogExpiration(void* watchdog_pointer, double expiration, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->writeExpiration((uint32_t)(expiration * (kSystemClockTicksPerMicrosecond * 1e6)), status); -} - -/** - * Find out if the watchdog is currently enabled or disabled (mortal or immortal). - * - * @return Enabled or disabled. - */ -bool getWatchdogEnabled(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool enabled = !watchdog->readImmortal(status); - return enabled; -} - -/** - * Enable or disable the watchdog timer. - * - * When enabled, you must keep feeding the watchdog timer to - * keep the watchdog active, and hence the dangerous parts - * (motor outputs, etc.) can keep functioning. - * When disabled, the watchdog is immortal and will remain active - * even without being fed. It will also ignore any kill commands - * while disabled. - * - * @param enabled Enable or disable the watchdog. - */ -void setWatchdogEnabled(void* watchdog_pointer, bool enabled, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->writeImmortal(!enabled, status); -} - -/** - * Check in on the watchdog and make sure he's still kicking. - * - * This indicates that your watchdog is allowing the system to operate. - * It is still possible that the network communications is not allowing the - * system to run, but you can check this to make sure it's not your fault. - * Check IsSystemActive() for overall system status. - * - * If the watchdog is disabled, then your watchdog is immortal. - * - * @return Is the watchdog still alive? - */ -bool isWatchdogAlive(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool alive = watchdog->readStatus_Alive(status); - return alive; -} - -/** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ -bool isWatchdogSystemActive(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool alive = watchdog->readStatus_SystemActive(status); - return alive; -} diff --git a/hal/AthenaXX/src/main/native/cpp/Resource.cpp b/hal/AthenaXX/src/main/native/cpp/Resource.cpp deleted file mode 100644 index a2baa41e16..0000000000 --- a/hal/AthenaXX/src/main/native/cpp/Resource.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "HAL/cpp/Resource.h" -#include "HAL/Errors.h" -#include - -ReentrantSemaphore Resource::m_createLock; - -/** - * Allocate storage for a new instance of Resource. - * Allocate a bool array of values that will get initialized to indicate that no resources - * have been allocated yet. The indicies of the resources are [0 .. elements - 1]. - */ -Resource::Resource(uint32_t elements) -{ - Synchronized sync(m_createLock); - m_size = elements; - m_isAllocated = new bool[m_size]; - for (uint32_t i=0; i < m_size; i++) - { - m_isAllocated[i] = false; - } -} - -/** - * Factory method to create a Resource allocation-tracker *if* needed. - * - * @param r -- address of the caller's Resource pointer. If *r == NULL, this - * will construct a Resource and make *r point to it. If *r != NULL, i.e. - * the caller already has a Resource instance, this won't do anything. - * @param elements -- the number of elements for this Resource allocator to - * track, that is, it will allocate resource numbers in the range - * [0 .. elements - 1]. - */ -/*static*/ void Resource::CreateResourceObject(Resource **r, uint32_t elements) -{ - Synchronized sync(m_createLock); - if (*r == NULL) - { - *r = new Resource(elements); - } -} - -/** - * Delete the allocated array or resources. - * This happens when the module is unloaded (provided it was statically allocated). - */ -Resource::~Resource() -{ - delete[] m_isAllocated; -} - -/** - * Allocate a resource. - * When a resource is requested, mark it allocated. In this case, a free resource value - * within the range is located and returned after it is marked allocated. - */ -uint32_t Resource::Allocate(const char *resourceDesc) -{ - Synchronized sync(m_allocateLock); - for (uint32_t i=0; i < m_size; i++) - { - if (!m_isAllocated[i]) - { - m_isAllocated[i] = true; - return i; - } - } - // TODO: wpi_setWPIErrorWithContext(NoAvailableResources, resourceDesc); - return ~0ul; -} - -/** - * Allocate a specific resource value. - * The user requests a specific resource value, i.e. channel number and it is verified - * unallocated, then returned. - */ -uint32_t Resource::Allocate(uint32_t index, const char *resourceDesc) -{ - Synchronized sync(m_allocateLock); - if (index >= m_size) - { - // TODO: wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, resourceDesc); - return ~0ul; - } - if ( m_isAllocated[index] ) - { - // TODO: wpi_setWPIErrorWithContext(ResourceAlreadyAllocated, resourceDesc); - return ~0ul; - } - m_isAllocated[index] = true; - return index; -} - - -/** - * Free an allocated resource. - * After a resource is no longer needed, for example a destructor is called for a channel assignment - * class, Free will release the resource value so it can be reused somewhere else in the program. - */ -void Resource::Free(uint32_t index) -{ - Synchronized sync(m_allocateLock); - if (index == ~0ul) return; - if (index >= m_size) - { - // TODO: wpi_setWPIError(NotAllocated); - return; - } - if (!m_isAllocated[index]) - { - // TODO: wpi_setWPIError(NotAllocated); - return; - } - m_isAllocated[index] = false; -} diff --git a/hal/AthenaXX/src/main/native/cpp/StackTrace.cpp b/hal/AthenaXX/src/main/native/cpp/StackTrace.cpp deleted file mode 100644 index 7629925728..0000000000 --- a/hal/AthenaXX/src/main/native/cpp/StackTrace.cpp +++ /dev/null @@ -1,15 +0,0 @@ - -#include "HAL/cpp/StackTrace.h" - -#include "HAL/HAL.h" -#include "../ChipObject.h" -#include - - -void printCurrentStackTrace() { - // TODO: Implement -} - -bool getErrnoToName(int32_t errNo, char* name) { - return false; // TODO: Implement -} diff --git a/hal/AthenaXX/src/main/native/cpp/Synchronized.cpp b/hal/AthenaXX/src/main/native/cpp/Synchronized.cpp deleted file mode 100644 index c20d333a43..0000000000 --- a/hal/AthenaXX/src/main/native/cpp/Synchronized.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "HAL/cpp/Synchronized.h" -#include "HAL/Semaphore.h" - -/** - * Synchronized class deals with critical regions. - * Declare a Synchronized object at the beginning of a block. That will take the semaphore. - * When the code exits from the block it will call the destructor which will give the semaphore. - * This ensures that no matter how the block is exited, the semaphore will always be released. - * Use the CRITICAL_REGION(SEM_ID) and END_REGION macros to make the code look cleaner (see header file) - * @param semaphore The semaphore controlling this critical region. - */ -Synchronized::Synchronized(MUTEX_ID semaphore) -{ - m_mutex = semaphore; - m_semaphore = NULL; - takeMutex(m_mutex, SEMAPHORE_WAIT_FOREVER); -} - -Synchronized::Synchronized(SEMAPHORE_ID semaphore) -{ - m_mutex = NULL; - m_semaphore = semaphore; - takeSemaphore(m_semaphore, SEMAPHORE_WAIT_FOREVER); -} - -Synchronized::Synchronized(ReentrantSemaphore& semaphore) -{ - m_mutex = semaphore.m_semaphore; - m_semaphore = NULL; - takeMutex(m_mutex, SEMAPHORE_WAIT_FOREVER); -} - -/** - * This destructor unlocks the semaphore. - */ -Synchronized::~Synchronized() -{ - if (m_mutex != NULL) { - giveMutex(m_mutex); - } else { - giveSemaphore(m_semaphore); - } -} diff --git a/hal/AthenaXXJava/pom.xml b/hal/AthenaXXJava/pom.xml deleted file mode 100644 index 2baf94b596..0000000000 --- a/hal/AthenaXXJava/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.hal - libHALAthenaXXJava - so - - - edu.wpi.first.wpilib.templates.athena - shared-library - 0.1.0-SNAPSHOT - - - - - com.nativelibs4java - jnaerator-runtime - 0.12-SNAPSHOT - compile - - - edu.wpi.first.wpilib.hal - include - 0.1.0-SNAPSHOT - inczip - - - com.ni.first.libraries - libFRC_NetworkCommunication - 0.1.0-SNAPSHOT - so - - - - - - sonatype - Sonatype OSS Snapshots Repository - http://oss.sonatype.org/content/groups/public - - - - nativelibs4java-repo - http://nativelibs4java.sourceforge.net/maven - - - - - - - sonatype - Sonatype OSS Snapshots Repository - http://oss.sonatype.org/content/groups/public - - - - nativelibs4java-repo - http://nativelibs4java.sourceforge.net/maven - - - - - - - org.codehaus.mojo - native-maven-plugin - - - - ../AthenaXX/src/main/native - - **/*.cpp - - - - - - - com.nativelibs4java - maven-jnaerator-plugin - 0.12-SNAPSHOT - true - - - process-classes - - generate - - - - - - - diff --git a/hal/AthenaXXJava/src/main/jnaerator/config.jnaerator b/hal/AthenaXXJava/src/main/jnaerator/config.jnaerator deleted file mode 100644 index fcc6546955..0000000000 --- a/hal/AthenaXXJava/src/main/jnaerator/config.jnaerator +++ /dev/null @@ -1,15 +0,0 @@ --dontCastConstants --runtime JNAerator --direct -// -reification --M__java=true - --package edu.wpi.first.wpilibj.hal -// -entryClass HAL - --library HAL --Itarget/native/include/ - -target/native/include/HAL/HAL.h -// include/HAL/Errors.h - diff --git a/hal/Azalea/pom.xml b/hal/Azalea/pom.xml deleted file mode 100644 index fdaa025fa7..0000000000 --- a/hal/Azalea/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.hal - libHALAzalea - a - - - edu.wpi.first.wpilib.templates.azalea - static-library - 0.1.0-SNAPSHOT - ../../maven-utilities/azalea/static-library/pom.xml - - - - - edu.wpi.first.wpilib.hal - include - 0.1.0-SNAPSHOT - inczip - - - - - - - org.codehaus.mojo - native-maven-plugin - - - - src/main/native - - **/*.cpp - - - - - - - - diff --git a/hal/Azalea/src/main/native/Analog.cpp b/hal/Azalea/src/main/native/Analog.cpp deleted file mode 100644 index 54a6a96587..0000000000 --- a/hal/Azalea/src/main/native/Analog.cpp +++ /dev/null @@ -1,686 +0,0 @@ - -#include "HAL/Analog.h" - -#include "Port.h" -#include "HAL/Errors.h" -#include "HAL/Semaphore.h" -#include "ChipObject.h" -#include "HAL/cpp/Synchronized.h" -#include "HAL/cpp/Resource.h" -#include "NetworkCommunication/AICalibration.h" -#include "NetworkCommunication/LoadOut.h" - -static const long kTimebase = 40000000; ///< 40 MHz clock -static const long kDefaultOversampleBits = 0; -static const long kDefaultAverageBits = 7; -static const float kDefaultSampleRate = 50000.0; -static const uint32_t kAnalogPins = 8; - -static const uint8_t kAccumulatorModuleNumber = 1; -static const uint32_t kAccumulatorNumChannels = 2; -static const uint32_t kAccumulatorChannels[] = {1, 2}; - -struct analog_port_t { - Port port; - tAI *module; - tAccumulator *accumulator; -}; -typedef struct analog_port_t AnalogPort; - -static bool analogSampleRateSet[2] = {false, false}; -static MUTEX_ID analogRegisterWindowSemaphore = NULL; -static tAI* analogModules[2] = {NULL, NULL}; -static uint32_t analogNumChannelsToActivate[2] = {0, 0}; - -// Utility methods defined below. -uint32_t getAnalogNumActiveChannels(uint8_t module, int32_t *status); -uint32_t getAnalogNumChannelsToActivate(uint8_t module, int32_t *status); -void setAnalogNumChannelsToActivate(uint8_t module, uint32_t channels); - -bool analogModulesInitialized = false; - -/** - * Initialize the analog modules. - */ -void initializeAnalog(int32_t *status) { - if (analogModulesInitialized) return; - // Needs to be global since the protected resource spans both module singletons. - analogRegisterWindowSemaphore = initializeMutex(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE); - for (unsigned int i = 0; i < (sizeof(analogModules)/sizeof(analogModules[0])); i++) { - analogModules[i] = tAI::create(i, status); - setAnalogNumChannelsToActivate(i + 1, kAnalogPins); - setAnalogSampleRateWithModule(i + 1, kDefaultSampleRate, status); - } - analogModulesInitialized = true; -} - -/** - * Initialize the analog port using the given port object. - */ -void* initializeAnalogPort(void* port_pointer, int32_t *status) { - initializeAnalog(status); - Port* port = (Port*) port_pointer; - - // Initialize port structure - AnalogPort* analog_port = new AnalogPort(); - analog_port->port = *port; - analog_port->module = analogModules[analog_port->port.module-1]; - if (isAccumulatorChannel(analog_port, status)) { - analog_port->accumulator = tAccumulator::create(port->pin - 1, status); - } else analog_port->accumulator = NULL; - - // Set default configuration - analog_port->module->writeScanList(port->pin - 1, port->pin - 1, status); - setAnalogAverageBits(analog_port, kDefaultAverageBits, status); - setAnalogOversampleBits(analog_port, kDefaultOversampleBits, status); - return analog_port; -} - - -/** - * Check that the analog module number is valid. - * - * @return Analog module is valid and present - */ -bool checkAnalogModule(uint8_t module) { - if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Analog, module - 1)) - return true; - return false; -} - -/** - * Check that the analog channel number is value. - * Verify that the analog channel number is one of the legal channel numbers. Channel numbers - * are 1-based. - * - * @return Analog channel is valid - */ -bool checkAnalogChannel(uint32_t pin) { - if (pin > 0 && pin <= kAnalogPins) - return true; - return false; -} - -/** - * Set the sample rate on module 0. - * - * This is a global setting for the module and effects all channels. - * - * @param samplesPerSecond The number of samples per channel per second. - */ -void setAnalogSampleRate(double samplesPerSecond, int32_t *status) { - setAnalogSampleRateWithModule(0, samplesPerSecond, status); -} - -/** - * Get the current sample rate on module 0. - * - * This assumes one entry in the scan list. - * This is a global setting for the module and effects all channels. - * - * @return Sample rate. - */ -float getAnalogSampleRate(int32_t *status) { - return getAnalogSampleRateWithModule(0, status); -} - -/** - * Set the sample rate on the module. - * - * This is a global setting for the module and effects all channels. - * - * @param module The module to use - * @param samplesPerSecond The number of samples per channel per second. - */ -void setAnalogSampleRateWithModule(uint8_t module, double samplesPerSecond, int32_t *status) { - // TODO: This will change when variable size scan lists are implemented. - // TODO: Need float comparison with epsilon. - //wpi_assert(!sampleRateSet || GetSampleRate() == samplesPerSecond); - analogSampleRateSet[module-1] = true; - - // Compute the convert rate - uint32_t ticksPerSample = (uint32_t)((float)kTimebase / samplesPerSecond); - uint32_t ticksPerConversion = ticksPerSample / getAnalogNumChannelsToActivate(module, status); - // ticksPerConversion must be at least 80 - if (ticksPerConversion < 80) { - if ((*status) >= 0) *status = SAMPLE_RATE_TOO_HIGH; - ticksPerConversion = 80; - } - - // Atomically set the scan size and the convert rate so that the sample rate is constant - tAI::tConfig config; - config.ScanSize = getAnalogNumChannelsToActivate(module, status); - config.ConvertRate = ticksPerConversion; - analogModules[module-1]->writeConfig(config, status); - - // Indicate that the scan size has been commited to hardware. - setAnalogNumChannelsToActivate(module, 0); -} - -/** - * Get the current sample rate on the module. - * - * This assumes one entry in the scan list. - * This is a global setting for the module and effects all channels. - * - * @param module The module to use - * @return Sample rate. - */ -float getAnalogSampleRateWithModule(uint8_t module, int32_t *status) { - uint32_t ticksPerConversion = analogModules[module-1]->readLoopTiming(status); - uint32_t ticksPerSample = ticksPerConversion * getAnalogNumActiveChannels(module, status); - return (float)kTimebase / (float)ticksPerSample; -} - - -/** - * Set the number of averaging bits. - * - * This sets the number of averaging bits. The actual number of averaged samples is 2**bits. - * Use averaging to improve the stability of your measurement at the expense of sampling rate. - * The averaging is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to configure. - * @param bits Number of bits to average. - */ -void setAnalogAverageBits(void* analog_port_pointer, uint32_t bits, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - port->module->writeAverageBits(port->port.pin - 1, bits, status); -} - -/** - * Get the number of averaging bits. - * - * This gets the number of averaging bits from the FPGA. The actual number of averaged samples is 2**bits. - * The averaging is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Bits to average. - */ -uint32_t getAnalogAverageBits(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - uint32_t result = port->module->readAverageBits(port->port.pin - 1, status); - return result; -} - -/** - * Set the number of oversample bits. - * - * This sets the number of oversample bits. The actual number of oversampled values is 2**bits. - * Use oversampling to improve the resolution of your measurements at the expense of sampling rate. - * The oversampling is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @param bits Number of bits to oversample. - */ -void setAnalogOversampleBits(void* analog_port_pointer, uint32_t bits, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - port->module->writeOversampleBits(port->port.pin - 1, bits, status); -} - - -/** - * Get the number of oversample bits. - * - * This gets the number of oversample bits from the FPGA. The actual number of oversampled values is - * 2**bits. The oversampling is done automatically in the FPGA. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Bits to oversample. - */ -uint32_t getAnalogOversampleBits(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - uint32_t result = port->module->readOversampleBits(port->port.pin - 1, status); - return result; -} - -/** - * Get a sample straight from the channel on this module. - * - * The sample is a 12-bit value representing the -10V to 10V range of the A/D converter in the module. - * The units are in A/D converter codes. Use GetVoltage() to get the analog value in calibrated units. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A sample straight from the channel on this module. - */ -int16_t getAnalogValue(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - int16_t value; - checkAnalogChannel(port->port.pin); - - tAI::tReadSelect readSelect; - readSelect.Channel = port->port.pin - 1; - readSelect.Module = port->port.module - 1; - readSelect.Averaged = false; - - { - Synchronized sync(analogRegisterWindowSemaphore); - port->module->writeReadSelect(readSelect, status); - port->module->strobeLatchOutput(status); - value = (int16_t) port->module->readOutput(status); - } - - return value; -} - -/** - * Get a sample from the output of the oversample and average engine for the channel. - * - * The sample is 12-bit + the value configured in SetOversampleBits(). - * The value configured in SetAverageBits() will cause this value to be averaged 2**bits number of samples. - * This is not a sliding window. The sample will not change until 2**(OversamplBits + AverageBits) samples - * have been acquired from the module on this channel. - * Use GetAverageVoltage() to get the analog value in calibrated units. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A sample from the oversample and average engine for the channel. - */ -int32_t getAnalogAverageValue(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - int16_t value; - checkAnalogChannel(port->port.pin); - - tAI::tReadSelect readSelect; - readSelect.Channel = port->port.pin - 1; - readSelect.Module = port->port.module - 1; - readSelect.Averaged = true; - - { - Synchronized sync(analogRegisterWindowSemaphore); - port->module->writeReadSelect(readSelect, status); - port->module->strobeLatchOutput(status); - value = (int16_t) port->module->readOutput(status); - } - - return value; -} - -/** - * Get a scaled sample straight from the channel on this module. - * - * The value is scaled to units of Volts using the calibrated scaling data from GetLSBWeight() and GetOffset(). - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A scaled sample straight from the channel on this module. - */ -float getAnalogVoltage(void* analog_port_pointer, int32_t *status) { - int16_t value = getAnalogValue(analog_port_pointer, status); - uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status); - int32_t offset = getAnalogOffset(analog_port_pointer, status); - float voltage = LSBWeight * 1.0e-9 * value - offset * 1.0e-9; - return voltage; -} - -/** - * Get a scaled sample from the output of the oversample and average engine for the channel. - * - * The value is scaled to units of Volts using the calibrated scaling data from GetLSBWeight() and GetOffset(). - * Using oversampling will cause this value to be higher resolution, but it will update more slowly. - * Using averaging will cause this value to be more stable, but it will update more slowly. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return A scaled sample from the output of the oversample and average engine for the channel. - */ -float getAnalogAverageVoltage(void* analog_port_pointer, int32_t *status) { - int32_t value = getAnalogAverageValue(analog_port_pointer, status); - uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status); - int32_t offset = getAnalogOffset(analog_port_pointer, status); - uint32_t oversampleBits = getAnalogOversampleBits(analog_port_pointer, status); - float voltage = ((LSBWeight * 1.0e-9 * value) / (float)(1 << oversampleBits)) - offset * 1.0e-9; - return voltage; -} - -/** - * Convert a voltage to a raw value for a specified channel. - * - * This process depends on the calibration of each channel, so the channel - * must be specified. - * - * @todo This assumes raw values. Oversampling not supported as is. - * - * @param analog_port_pointer Pointer to the analog port to use. - * @param voltage The voltage to convert. - * @return The raw value for the channel. - */ -int32_t getAnalogVoltsToValue(void* analog_port_pointer, double voltage, int32_t *status) { - if (voltage > 10.0) { - voltage = 10.0; - *status = VOLTAGE_OUT_OF_RANGE; - } - if (voltage < -10.0) { - voltage = -10.0; - *status = VOLTAGE_OUT_OF_RANGE; - } - uint32_t LSBWeight = getAnalogLSBWeight(analog_port_pointer, status); - int32_t offset = getAnalogOffset(analog_port_pointer, status); - int32_t value = (int32_t) ((voltage + offset * 1.0e-9) / (LSBWeight * 1.0e-9)); - return value; -} - -/** - * Get the factory scaling least significant bit weight constant. - * The least significant bit weight constant for the channel that was calibrated in - * manufacturing and stored in an eeprom in the module. - * - * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9) - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Least significant bit weight. - */ -uint32_t getAnalogLSBWeight(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - uint32_t lsbWeight = FRC_NetworkCommunication_nAICalibration_getLSBWeight(port->module->getSystemIndex(), - port->port.pin - 1, status); - return lsbWeight; -} - -/** - * Get the factory scaling offset constant. - * The offset constant for the channel that was calibrated in manufacturing and stored - * in an eeprom in the module. - * - * Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9) - * - * @param analog_port_pointer Pointer to the analog port to use. - * @return Offset constant. - */ -int32_t getAnalogOffset(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - int32_t offset = FRC_NetworkCommunication_nAICalibration_getOffset(port->module->getSystemIndex(), - port->port.pin - 1, status); - return offset; -} - - -/** - * Return the number of channels on the module in use. - * - * @return Active channels. - */ -uint32_t getAnalogNumActiveChannels(uint8_t module, int32_t *status) { - uint32_t scanSize = analogModules[module-1]->readConfig_ScanSize(status); - if (scanSize == 0) - return 8; - return scanSize; -} - -/** - * Get the number of active channels. - * - * This is an internal function to allow the atomic update of both the - * number of active channels and the sample rate. - * - * When the number of channels changes, use the new value. Otherwise, - * return the curent value. - * - * @return Value to write to the active channels field. - */ -uint32_t getAnalogNumChannelsToActivate(uint8_t module, int32_t *status) { - if(analogNumChannelsToActivate[module-1] == 0) return getAnalogNumActiveChannels(module, status); - return analogNumChannelsToActivate[module-1]; -} - -/** - * Set the number of active channels. - * - * Store the number of active channels to set. Don't actually commit to hardware - * until SetSampleRate(). - * - * @param channels Number of active channels. - */ -void setAnalogNumChannelsToActivate(uint8_t module, uint32_t channels) { - analogNumChannelsToActivate[module-1] = channels; -} - -//// Accumulator Stuff - -/** - * Is the channel attached to an accumulator. - * - * @return The analog channel is attached to an accumulator. - */ -bool isAccumulatorChannel(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if(port->port.module != kAccumulatorModuleNumber) return false; - for (uint32_t i=0; i < kAccumulatorNumChannels; i++) { - if (port->port.pin == kAccumulatorChannels[i]) return true; - } - return false; -} - -/** - * Initialize the accumulator. - */ -void initAccumulator(void* analog_port_pointer, int32_t *status) { - setAccumulatorCenter(analog_port_pointer, 0, status); - resetAccumulator(analog_port_pointer, status); -} - -/** - * Resets the accumulator to the initial value. - */ -void resetAccumulator(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - port->accumulator->strobeReset(status); -} - -/** - * Set the center value of the accumulator. - * - * The center value is subtracted from each A/D value before it is added to the accumulator. This - * is used for the center value of devices like gyros and accelerometers to make integration work - * and to take the device offset into account when integrating. - * - * This center value is based on the output of the oversampled and averaged source from channel 1. - * Because of this, any non-zero oversample bits will affect the size of the value for this field. - */ -void setAccumulatorCenter(void* analog_port_pointer, int32_t center, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - port->accumulator->writeCenter(center, status); -} - -/** - * Set the accumulator's deadband. - */ -void setAccumulatorDeadband(void* analog_port_pointer, int32_t deadband, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - port->accumulator->writeDeadband(deadband, status); -} - -/** - * Read the accumulated value. - * - * Read the value that has been accumulating on channel 1. - * The accumulator is attached after the oversample and average engine. - * - * @return The 64-bit value accumulated since the last Reset(). - */ -int64_t getAccumulatorValue(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return 0; - } - int64_t value = port->accumulator->readOutput_Value(status); - return value; -} - -/** - * Read the number of accumulated values. - * - * Read the count of the accumulated values since the accumulator was last Reset(). - * - * @return The number of times samples from the channel were accumulated. - */ -uint32_t getAccumulatorCount(void* analog_port_pointer, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return 0; - } - return port->accumulator->readOutput_Count(status); -} - -/** - * Read the accumulated value and the number of accumulated values atomically. - * - * This function reads the value and count from the FPGA atomically. - * This can be used for averaging. - * - * @param value Pointer to the 64-bit accumulated output. - * @param count Pointer to the number of accumulation cycles. - */ -void getAccumulatorOutput(void* analog_port_pointer, int64_t *value, uint32_t *count, int32_t *status) { - AnalogPort* port = (AnalogPort*) analog_port_pointer; - if (port->accumulator == NULL) { - *status = NULL_PARAMETER; - return; - } - if (value == NULL || count == NULL) { - *status = NULL_PARAMETER; - return; - } - - tAccumulator::tOutput output = port->accumulator->readOutput(status); - *value = output.Value; - *count = output.Count; -} - - -struct trigger_t { - tAnalogTrigger* trigger; - AnalogPort* port; - uint32_t index; -}; -typedef struct trigger_t AnalogTrigger; - -static Resource *triggers = NULL; - -void* initializeAnalogTrigger(void* port_pointer, uint32_t *index, int32_t *status) { - Port* port = (Port*) port_pointer; - Resource::CreateResourceObject(&triggers, tAnalogTrigger::kNumSystems); - - AnalogTrigger* trigger = new AnalogTrigger(); - trigger->port = (AnalogPort*) initializeAnalogPort(port, status); - trigger->index = triggers->Allocate("Analog Trigger"); - *index = trigger->index; - // TODO: if (index == ~0ul) { CloneError(triggers); return; } - - trigger->trigger = tAnalogTrigger::create(trigger->index, status); - trigger->trigger->writeSourceSelect_Channel(port->pin - 1, status); - trigger->trigger->writeSourceSelect_Module(port->module - 1, status); - - return trigger; -} - -void cleanAnalogTrigger(void* analog_trigger_pointer, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - triggers->Free(trigger->index); - delete trigger->trigger; - delete trigger; -} - -void setAnalogTriggerLimitsRaw(void* analog_trigger_pointer, int32_t lower, int32_t upper, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (lower > upper) { - *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR; - } - trigger->trigger->writeLowerLimit(lower, status); - trigger->trigger->writeUpperLimit(upper, status); -} - -/** - * Set the upper and lower limits of the analog trigger. - * The limits are given as floating point voltage values. - */ -void setAnalogTriggerLimitsVoltage(void* analog_trigger_pointer, double lower, double upper, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (lower > upper) { - *status = ANALOG_TRIGGER_LIMIT_ORDER_ERROR; - } - // TODO: This depends on the averaged setting. Only raw values will work as is. - trigger->trigger->writeLowerLimit(getAnalogVoltsToValue(trigger->port, lower, status), status); - trigger->trigger->writeUpperLimit(getAnalogVoltsToValue(trigger->port, upper, status), status); -} - -/** - * Configure the analog trigger to use the averaged vs. raw values. - * If the value is true, then the averaged value is selected for the analog trigger, otherwise - * the immediate value is used. - */ -void setAnalogTriggerAveraged(void* analog_trigger_pointer, bool useAveragedValue, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (trigger->trigger->readSourceSelect_Filter(status) != 0) { - *status = INCOMPATIBLE_STATE; - // TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not support average and filtering at the same time."); - } - trigger->trigger->writeSourceSelect_Averaged(useAveragedValue, status); -} - -/** - * Configure the analog trigger to use a filtered value. - * The analog trigger will operate with a 3 point average rejection filter. This is designed to - * help with 360 degree pot applications for the period where the pot crosses through zero. - */ -void setAnalogTriggerFiltered(void* analog_trigger_pointer, bool useFilteredValue, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - if (trigger->trigger->readSourceSelect_Averaged(status) != 0) { - *status = INCOMPATIBLE_STATE; - // TODO: wpi_setWPIErrorWithContext(IncompatibleMode, "Hardware does not support average and filtering at the same time."); - } - trigger->trigger->writeSourceSelect_Filter(useFilteredValue, status); -} - -/** - * Return the InWindow output of the analog trigger. - * True if the analog input is between the upper and lower limits. - * @return The InWindow output of the analog trigger. - */ -bool getAnalogTriggerInWindow(void* analog_trigger_pointer, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - return trigger->trigger->readOutput_InHysteresis(trigger->index, status) != 0; -} - -/** - * Return the TriggerState output of the analog trigger. - * True if above upper limit. - * False if below lower limit. - * If in Hysteresis, maintain previous state. - * @return The TriggerState output of the analog trigger. - */ -bool getAnalogTriggerTriggerState(void* analog_trigger_pointer, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - return trigger->trigger->readOutput_OverLimit(trigger->index, status) != 0; -} - -/** - * Get the state of the analog trigger output. - * @return The state of the analog trigger output. - */ -bool getAnalogTriggerOutput(void* analog_trigger_pointer, AnalogTriggerType type, int32_t *status) { - AnalogTrigger* trigger = (AnalogTrigger*) analog_trigger_pointer; - bool result = false; - switch(type) { - case kInWindow: - result = trigger->trigger->readOutput_InHysteresis(trigger->index, status); - case kState: - result = trigger->trigger->readOutput_OverLimit(trigger->index, status); - case kRisingPulse: - case kFallingPulse: - *status = ANALOG_TRIGGER_PULSE_OUTPUT_ERROR; - return false; - } - return result; -} diff --git a/hal/Azalea/src/main/native/ChipObject.h b/hal/Azalea/src/main/native/ChipObject.h deleted file mode 100644 index 607af92283..0000000000 --- a/hal/Azalea/src/main/native/ChipObject.h +++ /dev/null @@ -1,32 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#ifndef __ChipObject_h__ -#define __ChipObject_h__ - -#include -#include "ChipObject/NiRio.h" - -#include "ChipObject/tAccumulator.h" -#include "ChipObject/tAI.h" -#include "ChipObject/tAlarm.h" -#include "ChipObject/tAnalogTrigger.h" -#include "ChipObject/tCounter.h" -#include "ChipObject/tDIO.h" -#include "ChipObject/tDMA.h" -//#include "ChipObject/tDMAManager.h" -#include "ChipObject/tEncoder.h" -#include "ChipObject/tGlobal.h" -#include "ChipObject/tInterrupt.h" -#include "ChipObject/tInterruptManager.h" -#include "ChipObject/tSolenoid.h" -#include "ChipObject/tSPI.h" -#include "ChipObject/tWatchdog.h" - -using namespace nFPGA; -using namespace nFRC_2012_1_6_4; - -#endif diff --git a/hal/Azalea/src/main/native/ChipObject/Makefile b/hal/Azalea/src/main/native/ChipObject/Makefile deleted file mode 100644 index bc1916495a..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/Makefile +++ /dev/null @@ -1,2184 +0,0 @@ -# Wind River Workbench generated Makefile. -# Do not edit!!! -# -# The file ".wrmakefile" is the template used by the Wind River Workbench to -# generate the makefiles of this project. Add user-specific build targets and -# make rules only(!) in this project's ".wrmakefile" file. These will then be -# automatically dumped into the makefiles. - -WIND_HOME := $(subst \,/,$(WIND_HOME)) -WIND_BASE := $(subst \,/,$(WIND_BASE)) -WIND_USR := $(subst \,/,$(WIND_USR)) - -all : pre_build main_all post_build - -_clean :: - @echo "make: removing targets and objects of `pwd`" - -TRACE=0 -TRACEON=$(TRACE:0=@) -TRACE_FLAG=$(TRACEON:1=) - -MAKEFILE := Makefile - -BUILD_SPEC = PPC603gnu -DEBUG_MODE = 1 -SRC_DIR := . -BUILD_ROOT_DIR := -PRJ_ROOT_DIR := C:/windriver/workspace/WPILib -WS_ROOT_DIR := C:/windriver/workspace - -ALL_BUILD_SPECS := PPC32diab PPC32gnu PPC32sfdiab PPC32sfgnu \ - PPC403diab PPC403gnu PPC405diab PPC405gnu \ - PPC405sfdiab PPC405sfgnu PPC440diab PPC440gnu \ - PPC440sfdiab PPC440sfgnu PPC603diab PPC603gnu \ - PPC604diab PPC604gnu PPC85XXdiab PPC85XXgnu \ - PPC85XXsfdiab PPC85XXsfgnu PPC860sfdiab PPC860sfgnu \ - SIMLINUXdiab SIMLINUXgnu SIMNTdiab SIMNTgnu \ - SIMSPARCSOLARISdiab SIMSPARCSOLARISgnu -ENABLED_BUILD_SPECS := PPC603gnu - -ifeq ($(BUILD_SPEC),PPC32diab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC32diab_DEBUG -else -OBJ_DIR := PPC32diab -endif -endif -ifeq ($(BUILD_SPEC),PPC32gnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC32gnu_DEBUG -else -OBJ_DIR := PPC32gnu -endif -endif -ifeq ($(BUILD_SPEC),PPC32sfdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC32sfdiab_DEBUG -else -OBJ_DIR := PPC32sfdiab -endif -endif -ifeq ($(BUILD_SPEC),PPC32sfgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC32sfgnu_DEBUG -else -OBJ_DIR := PPC32sfgnu -endif -endif -ifeq ($(BUILD_SPEC),PPC403diab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC403diab_DEBUG -else -OBJ_DIR := PPC403diab -endif -endif -ifeq ($(BUILD_SPEC),PPC403gnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC403gnu_DEBUG -else -OBJ_DIR := PPC403gnu -endif -endif -ifeq ($(BUILD_SPEC),PPC405diab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC405diab_DEBUG -else -OBJ_DIR := PPC405diab -endif -endif -ifeq ($(BUILD_SPEC),PPC405gnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC405gnu_DEBUG -else -OBJ_DIR := PPC405gnu -endif -endif -ifeq ($(BUILD_SPEC),PPC405sfdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC405sfdiab_DEBUG -else -OBJ_DIR := PPC405sfdiab -endif -endif -ifeq ($(BUILD_SPEC),PPC405sfgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC405sfgnu_DEBUG -else -OBJ_DIR := PPC405sfgnu -endif -endif -ifeq ($(BUILD_SPEC),PPC440diab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC440diab_DEBUG -else -OBJ_DIR := PPC440diab -endif -endif -ifeq ($(BUILD_SPEC),PPC440gnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC440gnu_DEBUG -else -OBJ_DIR := PPC440gnu -endif -endif -ifeq ($(BUILD_SPEC),PPC440sfdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC440sfdiab_DEBUG -else -OBJ_DIR := PPC440sfdiab -endif -endif -ifeq ($(BUILD_SPEC),PPC440sfgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC440sfgnu_DEBUG -else -OBJ_DIR := PPC440sfgnu -endif -endif -ifeq ($(BUILD_SPEC),PPC603diab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC603diab_DEBUG -else -OBJ_DIR := PPC603diab -endif -endif -ifeq ($(BUILD_SPEC),PPC603gnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC603gnu_DEBUG -else -OBJ_DIR := PPC603gnu -endif -endif -ifeq ($(BUILD_SPEC),PPC604diab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC604diab_DEBUG -else -OBJ_DIR := PPC604diab -endif -endif -ifeq ($(BUILD_SPEC),PPC604gnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC604gnu_DEBUG -else -OBJ_DIR := PPC604gnu -endif -endif -ifeq ($(BUILD_SPEC),PPC85XXdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC85XXdiab_DEBUG -else -OBJ_DIR := PPC85XXdiab -endif -endif -ifeq ($(BUILD_SPEC),PPC85XXgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC85XXgnu_DEBUG -else -OBJ_DIR := PPC85XXgnu -endif -endif -ifeq ($(BUILD_SPEC),PPC85XXsfdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC85XXsfdiab_DEBUG -else -OBJ_DIR := PPC85XXsfdiab -endif -endif -ifeq ($(BUILD_SPEC),PPC85XXsfgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC85XXsfgnu_DEBUG -else -OBJ_DIR := PPC85XXsfgnu -endif -endif -ifeq ($(BUILD_SPEC),PPC860sfdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC860sfdiab_DEBUG -else -OBJ_DIR := PPC860sfdiab -endif -endif -ifeq ($(BUILD_SPEC),PPC860sfgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := PPC860sfgnu_DEBUG -else -OBJ_DIR := PPC860sfgnu -endif -endif -ifeq ($(BUILD_SPEC),SIMLINUXdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := SIMLINUXdiab_DEBUG -else -OBJ_DIR := SIMLINUXdiab -endif -endif -ifeq ($(BUILD_SPEC),SIMLINUXgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := SIMLINUXgnu_DEBUG -else -OBJ_DIR := SIMLINUXgnu -endif -endif -ifeq ($(BUILD_SPEC),SIMNTdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := SIMNTdiab_DEBUG -else -OBJ_DIR := SIMNTdiab -endif -endif -ifeq ($(BUILD_SPEC),SIMNTgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := SIMNTgnu_DEBUG -else -OBJ_DIR := SIMNTgnu -endif -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISdiab) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := SIMSPARCSOLARISdiab_DEBUG -else -OBJ_DIR := SIMSPARCSOLARISdiab -endif -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISgnu) -ifeq ($(DEBUG_MODE),1) -OBJ_DIR := SIMSPARCSOLARISgnu_DEBUG -else -OBJ_DIR := SIMSPARCSOLARISgnu -endif -endif - -ifeq ($(BUILD_SPEC),PPC32diab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC32gnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC32sfdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC32sfgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC403diab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC403gnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC405diab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC405gnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC405sfdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC405sfgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC440diab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC440gnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC440sfdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC440sfgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC603diab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC603gnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC604diab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC604gnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC85XXdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC85XXgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC85XXsfdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC85XXsfgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC860sfdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),PPC860sfgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),SIMLINUXdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),SIMLINUXgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),SIMNTdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),SIMNTgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISdiab) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISgnu) -SUBDIRS := -OBJECTS := - -PROJECT_TARGETS := $(OBJECTS) - -SUB_OBJECTS := -SUB_TARGETS := -endif - -PROJECT_TYPE = DKM -DEFINES = -EXPAND_DBG = 0 - -ifeq ($(BUILD_SPEC),PPC32diab) -VX_CPU_FAMILY = ppc -CPU = PPC32 -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPCFH:vxworks63 -Xstmw-slow -DPPC32_fp60x -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC32gnu) -VX_CPU_FAMILY = ppc -CPU = PPC32 -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mhard-float -mstrict-align -mno-implicit-fp -DPPC32_fp60x -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC32sfdiab) -VX_CPU_FAMILY = ppc -CPU = PPC32 -TOOL_FAMILY = diab -TOOL = sfdiab -TOOL_PATH = -CC_ARCH_SPEC = -tPPCFS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC32sfgnu) -VX_CPU_FAMILY = ppc -CPU = PPC32 -TOOL_FAMILY = gnu -TOOL = sfgnu -TOOL_PATH = -CC_ARCH_SPEC = -msoft-float -mstrict-align -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC403diab) -VX_CPU_FAMILY = ppc -CPU = PPC403 -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC403FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC403gnu) -VX_CPU_FAMILY = ppc -CPU = PPC403 -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=403 -mstrict-align -msoft-float -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC405diab) -VX_CPU_FAMILY = ppc -CPU = PPC405 -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC405FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC405gnu) -VX_CPU_FAMILY = ppc -CPU = PPC405 -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=405 -mstrict-align -msoft-float -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC405sfdiab) -VX_CPU_FAMILY = ppc -CPU = PPC405 -TOOL_FAMILY = diab -TOOL = sfdiab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC405FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC405sfgnu) -VX_CPU_FAMILY = ppc -CPU = PPC405 -TOOL_FAMILY = gnu -TOOL = sfgnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=405 -mstrict-align -msoft-float -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC440diab) -VX_CPU_FAMILY = ppc -CPU = PPC440 -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC440FH:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC440gnu) -VX_CPU_FAMILY = ppc -CPU = PPC440 -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=440 -mstrict-align -msoft-float -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC440sfdiab) -VX_CPU_FAMILY = ppc -CPU = PPC440 -TOOL_FAMILY = diab -TOOL = sfdiab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC440FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC440sfgnu) -VX_CPU_FAMILY = ppc -CPU = PPC440 -TOOL_FAMILY = gnu -TOOL = sfgnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=440 -mstrict-align -msoft-float -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC603diab) -VX_CPU_FAMILY = ppc -CPU = PPC603 -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC603FH:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC603gnu) -VX_CPU_FAMILY = ppc -CPU = PPC603 -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=603 -mstrict-align -mno-implicit-fp -mlongcall -LIBPATH = -LIBS = - -IDE_INCLUDES = -I.. -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC604diab) -VX_CPU_FAMILY = ppc -CPU = PPC604 -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC604FH:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC604gnu) -VX_CPU_FAMILY = ppc -CPU = PPC604 -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=604 -mstrict-align -mno-implicit-fp -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC85XXdiab) -VX_CPU_FAMILY = ppc -CPU = PPC85XX -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tPPCE500FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC85XXgnu) -VX_CPU_FAMILY = ppc -CPU = PPC85XX -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=8540 -mstrict-align -msoft-float -mabi=no-spe -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC85XXsfdiab) -VX_CPU_FAMILY = ppc -CPU = PPC85XX -TOOL_FAMILY = diab -TOOL = sfdiab -TOOL_PATH = -CC_ARCH_SPEC = -tPPCE500FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC85XXsfgnu) -VX_CPU_FAMILY = ppc -CPU = PPC85XX -TOOL_FAMILY = gnu -TOOL = sfgnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=8540 -mstrict-align -msoft-float -mabi=no-spe -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC860sfdiab) -VX_CPU_FAMILY = ppc -CPU = PPC860 -TOOL_FAMILY = diab -TOOL = sfdiab -TOOL_PATH = -CC_ARCH_SPEC = -tPPC860FS:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),PPC860sfgnu) -VX_CPU_FAMILY = ppc -CPU = PPC860 -TOOL_FAMILY = gnu -TOOL = sfgnu -TOOL_PATH = -CC_ARCH_SPEC = -mcpu=860 -mstrict-align -msoft-float -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),SIMLINUXdiab) -VX_CPU_FAMILY = simlinux -CPU = SIMLINUX -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tX86LH:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),SIMLINUXgnu) -VX_CPU_FAMILY = simlinux -CPU = SIMLINUX -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mtune=i486 -march=i486 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),SIMNTdiab) -VX_CPU_FAMILY = simpc -CPU = SIMNT -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tX86LH:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),SIMNTgnu) -VX_CPU_FAMILY = simpc -CPU = SIMNT -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -mtune=i486 -march=i486 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISdiab) -VX_CPU_FAMILY = simso -CPU = SIMSPARCSOLARIS -TOOL_FAMILY = diab -TOOL = diab -TOOL_PATH = -CC_ARCH_SPEC = -tSPARCFH:vxworks63 -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISgnu) -VX_CPU_FAMILY = simso -CPU = SIMSPARCSOLARIS -TOOL_FAMILY = gnu -TOOL = gnu -TOOL_PATH = -CC_ARCH_SPEC = -LIBPATH = -LIBS = - -IDE_INCLUDES = -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip - -IDE_LIBRARIES = -endif - - -ifeq ($(BUILD_SPEC),PPC32diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xstsw-slow -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC403diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC403gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC603diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC603gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC604diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC604gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXsfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXsfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC860sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC860sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMLINUXdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMLINUXgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -nostdlib -fno-builtin -fno-defer-pop -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMNTdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMNTgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -nostdlib -fno-builtin -fno-defer-pop -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C-Compiler = -g -else -DEBUGFLAGS_C-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.c - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccsparc $(DEBUGFLAGS_C-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xstsw-slow -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xstsw-slow -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xstsw-slow -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xstsw-slow -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC403diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC403gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC603diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC603gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG) $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL -D'SVN_REV="$(shell svnversion -n ..)"' $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG) $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL -D'SVN_REV="$(shell svnversion -n ..)"' $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG) $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL -D'SVN_REV="$(shell svnversion -n ..)"' $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG) $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL -D'SVN_REV="$(shell svnversion -n ..)"' $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC604diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC604gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXsfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXsfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC860sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC860sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMLINUXdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMLINUXgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -nostdlib -fno-builtin -fno-defer-pop -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMNTdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMNTgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -nostdlib -fno-builtin -fno-defer-pop -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xforce-declarations -Xmake-dependency=0xd $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_C++-Compiler = -g -else -DEBUGFLAGS_C++-Compiler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cpp - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccsparc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.C - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccsparc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cxx - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccsparc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.cc - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccsparc $(DEBUGFLAGS_C++-Compiler) $(CC_ARCH_SPEC) -ansi -Wall -MD -MP $(ADDED_C++FLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xstsw-slow -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC32sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC403diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC403gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC405sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC440sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC603diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC603gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC604diab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC604gnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXsfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC85XXsfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC860sfdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),PPC860sfgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccppc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMLINUXdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Wa,-Xmnem-mit -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMLINUXgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -nostdlib -fno-builtin -fno-defer-pop -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMNTdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Wa,-Xmnem-mit -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMNTgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -nostdlib -fno-builtin -fno-defer-pop -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccpentium $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISdiab) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -XO -Xsize-opt -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)dcc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -W:c:,-Xclib-optim-off -Xansi -Xlocal-data-area-static-only -Xpreprocess-assembly -Xcpp-no-space -Xmake-dependency=0xd $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif -ifeq ($(BUILD_SPEC),SIMSPARCSOLARISgnu) -ifeq ($(DEBUG_MODE),1) -DEBUGFLAGS_Assembler = -g -else -DEBUGFLAGS_Assembler = -O2 -fstrength-reduce -fno-builtin -endif -$(OBJ_DIR)/%.o : $(SRC_DIR)/%.s - $(TRACE_FLAG)echo "building $@"; $(TOOL_PATH)ccsparc $(DEBUGFLAGS_Assembler) $(CC_ARCH_SPEC) -ansi -xassembler-with-cpp -MD -MP $(ADDED_CFLAGS) $(IDE_INCLUDES) $(ADDED_INCLUDES) -DCPU=$(CPU) -DTOOL_FAMILY=$(TOOL_FAMILY) -DTOOL=$(TOOL) -D_WRS_KERNEL $(DEFINES) -o "$@" -c "$<" - -endif - - - - - --include $(PRJ_ROOT_DIR)/*.makefile - --include *.makefile - -main_all : external_build $(PROJECT_TARGETS) - @echo "make: built targets of `pwd`" - -# entry point for extending the build -external_build :: - @echo "" - -# main entry point for pre processing prior to the build -pre_build :: $(PRE_BUILD_STEP) generate_sources - @echo "" - -# entry point for generating sources prior to the build -generate_sources :: - @echo "" - -# main entry point for post processing after the build -post_build :: $(POST_BUILD_STEP) deploy_output - @echo "" - -# entry point for deploying output after the build -deploy_output :: - @echo "" - -clean :: external_clean $(CLEAN_STEP) _clean - -# entry point for extending the build clean -external_clean :: - @echo "" diff --git a/hal/Azalea/src/main/native/ChipObject/NiFpga.h b/hal/Azalea/src/main/native/ChipObject/NiFpga.h deleted file mode 100644 index c5f2bce86e..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/NiFpga.h +++ /dev/null @@ -1,2311 +0,0 @@ -/* - * FPGA Interface C API 2.0 header file. - * - * Copyright (c) 2011, - * National Instruments Corporation. - * All rights reserved. - */ - -#ifndef __NiFpga_h__ -#define __NiFpga_h__ - -/* - * Determine platform details. - */ -#if defined(_M_IX86) \ - || defined(_M_X64) \ - || defined(i386) \ - || defined(__i386__) \ - || defined(__amd64__) \ - || defined(__amd64) \ - || defined(__x86_64__) \ - || defined(__x86_64) \ - || defined(__i386) \ - || defined(_X86_) \ - || defined(__THW_INTEL__) \ - || defined(__I86__) \ - || defined(__INTEL__) \ - || defined(__X86__) \ - || defined(__386__) \ - || defined(__I86__) \ - || defined(M_I386) \ - || defined(M_I86) \ - || defined(_M_I386) \ - || defined(_M_I86) - #if defined(_WIN32) \ - || defined(_WIN64) \ - || defined(__WIN32__) \ - || defined(__TOS_WIN__) \ - || defined(__WINDOWS__) \ - || defined(_WINDOWS) \ - || defined(__WINDOWS_386__) \ - || defined(__CYGWIN__) - /* Either Windows or Phar Lap ETS. */ - #define NiFpga_Windows 1 - #elif defined(__linux) \ - || defined(__linux__) \ - || defined(__gnu_linux__) \ - || defined(linux) - #define NiFpga_Linux 1 - #else - #error Unsupported OS. - #endif -#elif defined(__powerpc) \ - || defined(__powerpc__) \ - || defined(__POWERPC__) \ - || defined(__ppc__) \ - || defined(__PPC) \ - || defined(_M_PPC) \ - || defined(_ARCH_PPC) \ - || defined(__PPC__) \ - || defined(__ppc) - #if defined(__vxworks) - #define NiFpga_VxWorks 1 - #else - #error Unsupported OS. - #endif -#else - #error Unsupported architecture. -#endif - -/* - * Determine compiler. - */ -#if defined(_MSC_VER) - #define NiFpga_Msvc 1 -#elif defined(__GNUC__) - #define NiFpga_Gcc 1 -#elif defined(_CVI_) && !defined(_TPC_) - #define NiFpga_Cvi 1 - /* Enables CVI Library Protection Errors. */ - #pragma EnableLibraryRuntimeChecking -#else - /* Unknown compiler. */ -#endif - -/* - * Determine compliance with different C/C++ language standards. - */ -#if defined(__cplusplus) - #define NiFpga_Cpp 1 - #if __cplusplus >= 199707L - #define NiFpga_Cpp98 1 - #endif -#endif -#if defined(__STDC__) - #define NiFpga_C89 1 - #if defined(__STDC_VERSION__) - #define NiFpga_C90 1 - #if __STDC_VERSION__ >= 199409L - #define NiFpga_C94 1 - #if __STDC_VERSION__ >= 199901L - #define NiFpga_C99 1 - #endif - #endif - #endif -#endif - -/* - * Determine ability to inline functions. - */ -#if NiFpga_Cpp || NiFpga_C99 - /* The inline keyword exists in C++ and C99. */ - #define NiFpga_Inline inline -#elif NiFpga_Msvc - /* Visual C++ (at least since 6.0) also supports an alternate keyword. */ - #define NiFpga_Inline __inline -#elif NiFpga_Gcc - /* GCC (at least since 2.95.2) also supports an alternate keyword. */ - #define NiFpga_Inline __inline__ -#elif !defined(NiFpga_Inline) - /* - * Disable inlining if inline support is unknown. To manually enable - * inlining, #define the following macro before #including NiFpga.h: - * - * #define NiFpga_Inline inline - */ - #define NiFpga_Inline -#endif - -/* - * Define exact-width integer types, if they have not already been defined. - */ -#if NiFpga_ExactWidthIntegerTypesDefined \ - || defined(_STDINT) \ - || defined(_STDINT_H) \ - || defined(_STDINT_H_) \ - || defined(_INTTYPES_H) \ - || defined(_INTTYPES_H_) \ - || defined(_SYS_STDINT_H) \ - || defined(_SYS_STDINT_H_) \ - || defined(_SYS_INTTYPES_H) \ - || defined(_SYS_INTTYPES_H_) \ - || defined(_STDINT_H_INCLUDED) \ - || defined(BOOST_CSTDINT_HPP) \ - || defined(_MSC_STDINT_H_) \ - || defined(_PSTDINT_H_INCLUDED) - /* Assume that exact-width integer types have already been defined. */ -#elif NiFpga_VxWorks - #include -#elif NiFpga_C99 \ - || NiFpga_Gcc /* GCC (at least since 3.0) has a stdint.h. */ \ - || defined(HAVE_STDINT_H) - /* Assume that stdint.h can be included. */ - #include -#elif NiFpga_Msvc \ - || NiFpga_Cvi - /* Manually define exact-width integer types. */ - typedef signed char int8_t; - typedef unsigned char uint8_t; - typedef short int16_t; - typedef unsigned short uint16_t; - typedef int int32_t; - typedef unsigned int uint32_t; - typedef __int64 int64_t; - typedef unsigned __int64 uint64_t; -#else - /* - * Exact-width integer types must be defined by the user, and the following - * macro must be #defined, before #including NiFpga.h: - * - * #define NiFpga_ExactWidthIntegerTypesDefined 1 - */ - #error Exact-width integer types must be defined by the user. See comment. -#endif - -/* Included for definition of size_t. */ -#include - -#if NiFpga_Cpp -extern "C" { -#endif - -/** - * A boolean value; either NiFpga_False or NiFpga_True. - */ -typedef uint8_t NiFpga_Bool; - -/** - * Represents a false condition. - */ -static const NiFpga_Bool NiFpga_False = 0; - -/** - * Represents a true condition. - */ -static const NiFpga_Bool NiFpga_True = 1; - -/** - * Represents the resulting status of a function call through its return value. - * 0 is success, negative values are errors, and positive values are warnings. - */ -typedef int32_t NiFpga_Status; - -/** - * No errors or warnings. - */ -static const NiFpga_Status NiFpga_Status_Success = 0; - -/** - * The timeout expired before the FIFO operation could complete. - */ -static const NiFpga_Status NiFpga_Status_FifoTimeout = -50400; - -/** - * A memory allocation failed. Try again after rebooting. - */ -static const NiFpga_Status NiFpga_Status_MemoryFull = -52000; - -/** - * An unexpected software error occurred. - */ -static const NiFpga_Status NiFpga_Status_SoftwareFault = -52003; - -/** - * A parameter to a function was not valid. This could be a NULL pointer, a bad - * value, etc. - */ -static const NiFpga_Status NiFpga_Status_InvalidParameter = -52005; - -/** - * A required resource was not found. The NiFpga.* library, the RIO resource, - * or some other resource may be missing, or the NiFpga.* library may not be - * the required minimum version. - */ -static const NiFpga_Status NiFpga_Status_ResourceNotFound = -52006; - -/** - * A required resource was not properly initialized. This could occur if - * NiFpga_Initialize was not called or a required NiFpga_IrqContext was not - * reserved. - */ -static const NiFpga_Status NiFpga_Status_ResourceNotInitialized = -52010; - -/** - * The FPGA is already running. - */ -static const NiFpga_Status NiFpga_Status_FpgaAlreadyRunning = -61003; - -/** - * The bitfile was not compiled for the specified resource's device type. - */ -static const NiFpga_Status NiFpga_Status_DeviceTypeMismatch = -61024; - -/** - * An error was detected in the communication between the host computer and the - * FPGA target. - */ -static const NiFpga_Status NiFpga_Status_CommunicationTimeout = -61046; - -/** - * The timeout expired before any of the IRQs were asserted. - */ -static const NiFpga_Status NiFpga_Status_IrqTimeout = -61060; - -/** - * The specified bitfile is invalid or corrupt. - */ -static const NiFpga_Status NiFpga_Status_CorruptBitfile = -61070; - -/** - * The FIFO depth is invalid. It was either 0, greater than the amount of - * available memory in the host computer, or greater than the maximum size - * allowed by the hardware. - */ -static const NiFpga_Status NiFpga_Status_BadDepth = -61072; - -/** - * The number of FIFO elements is invalid. Either the number is greater than - * the depth of the host memory DMA FIFO, or more elements were requested for - * release than had been acquired. - */ -static const NiFpga_Status NiFpga_Status_BadReadWriteCount = -61073; - -/** - * A hardware clocking error occurred. A derived clock lost lock with its base - * clock during the execution of the LabVIEW FPGA VI. If any base clocks with - * derived clocks are referencing an external source, make sure that the - * external source is connected and within the supported frequency, jitter, - * accuracy, duty cycle, and voltage specifications. Also verify that the - * characteristics of the base clock match the configuration specified in the - * FPGA Base Clock Properties. If all base clocks with derived clocks are - * generated from free-running, on-board sources, please contact National - * Instruments technical support at ni.com/support. - */ -static const NiFpga_Status NiFpga_Status_ClockLostLock = -61083; - -/** - * Operation could not be performed because the FPGA is busy. Stop all the - * activities on the FPGA before requesting this operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusy = -61141; - -/** - * Operation could not be performed because the FPGA is busy operating in FPGA - * Interface C API mode. Stop all the activities on the FPGA before requesting - * this operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterfaceCApi = -61200; - -/** - * The chassis is in Scan Interface programming mode. In order to run FPGA VIs, - * you must go to the chassis properties page, select FPGA programming mode, - * and deploy settings. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyScanInterface = -61201; - -/** - * Operation could not be performed because the FPGA is busy operating in FPGA - * Interface mode. Stop all the activities on the FPGA before requesting this - * operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyFpgaInterface = -61202; - -/** - * Operation could not be performed because the FPGA is busy operating in - * Interactive mode. Stop all the activities on the FPGA before requesting this - * operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyInteractive = -61203; - -/** - * Operation could not be performed because the FPGA is busy operating in - * Emulation mode. Stop all the activities on the FPGA before requesting this - * operation. - */ -static const NiFpga_Status NiFpga_Status_FpgaBusyEmulation = -61204; - -/** - * An unexpected internal error occurred. - */ -static const NiFpga_Status NiFpga_Status_InternalError = -61499; - -/** - * Access to the remote system was denied. Use MAX to check the Remote Device - * Access settings under Software>>NI-RIO>>NI-RIO Settings on the remote system. - */ -static const NiFpga_Status NiFpga_Status_AccessDenied = -63033; - -/** - * A connection could not be established to the specified remote device. Ensure - * that the device is on and accessible over the network, that NI-RIO software - * is installed, and that the RIO server is running and properly configured. - */ -static const NiFpga_Status NiFpga_Status_RpcConnectionError = -63040; - -/** - * The RPC session is invalid. The target may have reset or been rebooted. Check - * the network connection and retry the operation. - */ -static const NiFpga_Status NiFpga_Status_RpcSessionError = -63043; - -/** - * A Read FIFO or Write FIFO function was called while the host had acquired - * elements of the FIFO. Release all acquired elements before reading or - * writing. - */ -static const NiFpga_Status NiFpga_Status_FifoElementsCurrentlyAcquired = -63083; - -/** - * The bitfile could not be read. - */ -static const NiFpga_Status NiFpga_Status_BitfileReadError = -63101; - -/** - * The specified signature does not match the signature of the bitfile. If the - * bitfile has been recompiled, regenerate the C API and rebuild the - * application. - */ -static const NiFpga_Status NiFpga_Status_SignatureMismatch = -63106; - -/** - * Either the supplied resource name is invalid as a RIO resource name, or the - * device was not found. Use MAX to find the proper resource name for the - * intended device. - */ -static const NiFpga_Status NiFpga_Status_InvalidResourceName = -63192; - -/** - * The requested feature is not supported. - */ -static const NiFpga_Status NiFpga_Status_FeatureNotSupported = -63193; - -/** - * The NI-RIO software on the remote system is not compatible with the local - * NI-RIO software. Upgrade the NI-RIO software on the remote system. - */ -static const NiFpga_Status NiFpga_Status_VersionMismatch = -63194; - -/** - * The session is invalid or has been closed. - */ -static const NiFpga_Status NiFpga_Status_InvalidSession = -63195; - -/** - * The maximum number of open FPGA sessions has been reached. Close some open - * sessions. - */ -static const NiFpga_Status NiFpga_Status_OutOfHandles = -63198; - -/** - * Tests whether a status is an error. - * - * @param status status to check for an error - * @return whether the status was an error - */ -static NiFpga_Inline NiFpga_Bool NiFpga_IsError(const NiFpga_Status status) -{ - return status < NiFpga_Status_Success; -} - -/** - * Tests whether a status is not an error. Success and warnings are not errors. - * - * @param status status to check for an error - * @return whether the status was a success or warning - */ -static NiFpga_Inline NiFpga_Bool NiFpga_IsNotError(const NiFpga_Status status) -{ - return status >= NiFpga_Status_Success; -} - -/** - * Conditionally sets the status to a new value. The previous status is - * preserved unless the new status is more of an error, which means that - * warnings and errors overwrite successes, and errors overwrite warnings. New - * errors do not overwrite older errors, and new warnings do not overwrite - * older warnings. - * - * @param status status to conditionally set - * @param newStatus new status value that may be set - * @return the resulting status - */ -static NiFpga_Inline NiFpga_Status NiFpga_MergeStatus( - NiFpga_Status* const status, - const NiFpga_Status newStatus) -{ - if (!status) - { - return NiFpga_Status_InvalidParameter; - } - if (NiFpga_IsNotError(*status) - && (*status == NiFpga_Status_Success || NiFpga_IsError(newStatus))) - { - *status = newStatus; - } - return *status; -} - -/** - * This macro evaluates the expression only if the status is not an error. The - * expression must evaluate to an NiFpga_Status, such as a call to any NiFpga_* - * function, because the status will be set to the returned status if the - * expression is evaluated. - * - * You can use this macro to mimic status chaining in LabVIEW, where the status - * does not have to be explicitly checked after each call. Such code may look - * like the following example. - * - * NiFpga_Status status = NiFpga_Status_Success; - * NiFpga_IfIsNotError(status, NiFpga_WriteU32(...)); - * NiFpga_IfIsNotError(status, NiFpga_WriteU32(...)); - * NiFpga_IfIsNotError(status, NiFpga_WriteU32(...)); - * - * @param status status to check for an error - * @param expression expression to call if the incoming status is not an error - */ -#define NiFpga_IfIsNotError(status, expression) \ - if (NiFpga_IsNotError(status)) \ - { \ - NiFpga_MergeStatus(&status, (expression)); \ - } - -/** - * You must call this function before all other function calls. This function - * loads the NiFpga library so that all the other functions will work. If this - * function succeeds, you must call NiFpga_Finalize after all other function - * calls. - * - * @warning This function is not thread safe. - * - * @return result of the call - */ -NiFpga_Status NiFpga_Initialize(void); - -/** - * You must call this function after all other function calls if - * NiFpga_Initialize succeeds. This function unloads the NiFpga library. - * - * @warning This function is not thread safe. - * - * @return result of the call - */ -NiFpga_Status NiFpga_Finalize(void); - -/** - * A handle to an FPGA session. - */ -typedef uint32_t NiFpga_Session; - -/** - * Attributes that NiFpga_Open accepts. - */ -typedef enum -{ - NiFpga_OpenAttribute_NoRun = 1 -} NiFpga_OpenAttribute; - -/** - * Opens a session to the FPGA. This call ensures that the contents of the - * bitfile are programmed to the FPGA. The FPGA runs unless the - * NiFpga_OpenAttribute_NoRun attribute is used. - * - * Because different operating systems have different default current working - * directories for applications, you must pass an absolute path for the bitfile - * parameter. If you pass only the filename instead of an absolute path, the - * operating system may not be able to locate the bitfile. For example, the - * default current working directories are C:\ni-rt\system\ for Phar Lap ETS and - * /c/ for VxWorks. Because the generated *_Bitfile constant is a #define to a - * string literal, you can use C/C++ string-literal concatenation to form an - * absolute path. For example, if the bitfile is in the root directory of a - * Phar Lap ETS system, pass the following for the bitfile parameter. - * - * "C:\\" NiFpga_MyApplication_Bitfile - * - * @param bitfile path to the bitfile - * @param signature signature of the bitfile - * @param resource RIO resource string to open ("RIO0" or "rio://mysystem/RIO") - * @param attribute bitwise OR of any NiFpga_OpenAttributes, or 0 - * @param session outputs the session handle, which must be closed when no - * longer needed - * @return result of the call - */ -NiFpga_Status NiFpga_Open(const char* bitfile, - const char* signature, - const char* resource, - uint32_t attribute, - NiFpga_Session* session); - -/** - * Attributes that NiFpga_Close accepts. - */ -typedef enum -{ - NiFpga_CloseAttribute_NoResetIfLastSession = 1 -} NiFpga_CloseAttribute; - -/** - * Closes the session to the FPGA. The FPGA resets unless either another session - * is still open or you use the NiFpga_CloseAttribute_NoResetIfLastSession - * attribute. - * - * @param session handle to a currently open session - * @param attribute bitwise OR of any NiFpga_CloseAttributes, or 0 - * @return result of the call - */ -NiFpga_Status NiFpga_Close(NiFpga_Session session, - uint32_t attribute); - -/** - * Attributes that NiFpga_Run accepts. - */ -typedef enum -{ - NiFpga_RunAttribute_WaitUntilDone = 1 -} NiFpga_RunAttribute; - -/** - * Runs the FPGA VI on the target. If you use NiFpga_RunAttribute_WaitUntilDone, - * NiFpga_Run blocks the thread until the FPGA finishes running (if ever). - * - * @param session handle to a currently open session - * @param attribute bitwise OR of any NiFpga_RunAttributes, or 0 - * @return result of the call - */ -NiFpga_Status NiFpga_Run(NiFpga_Session session, - uint32_t attribute); - -/** - * Aborts the FPGA VI. - * - * @param session handle to a currently open session - * @return result of the call - */ -NiFpga_Status NiFpga_Abort(NiFpga_Session session); - -/** - * Resets the FPGA VI. - * - * @param session handle to a currently open session - * @return result of the call - */ -NiFpga_Status NiFpga_Reset(NiFpga_Session session); - -/** - * Re-downloads the FPGA bitstream to the target. - * - * @param session handle to a currently open session - * @return result of the call - */ -NiFpga_Status NiFpga_Download(NiFpga_Session session); - -/** - * Reads a boolean value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadBool(NiFpga_Session session, - uint32_t indicator, - NiFpga_Bool* value); - -/** - * Reads a signed 8-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI8(NiFpga_Session session, - uint32_t indicator, - int8_t* value); - -/** - * Reads an unsigned 8-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU8(NiFpga_Session session, - uint32_t indicator, - uint8_t* value); - -/** - * Reads a signed 16-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI16(NiFpga_Session session, - uint32_t indicator, - int16_t* value); - -/** - * Reads an unsigned 16-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU16(NiFpga_Session session, - uint32_t indicator, - uint16_t* value); - -/** - * Reads a signed 32-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI32(NiFpga_Session session, - uint32_t indicator, - int32_t* value); - -/** - * Reads an unsigned 32-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU32(NiFpga_Session session, - uint32_t indicator, - uint32_t* value); - -/** - * Reads a signed 64-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadI64(NiFpga_Session session, - uint32_t indicator, - int64_t* value); - -/** - * Reads an unsigned 64-bit integer value from a given indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param value outputs the value that was read - * @return result of the call - */ -NiFpga_Status NiFpga_ReadU64(NiFpga_Session session, - uint32_t indicator, - uint64_t* value); - -/** - * Writes a boolean value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteBool(NiFpga_Session session, - uint32_t control, - NiFpga_Bool value); - -/** - * Writes a signed 8-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI8(NiFpga_Session session, - uint32_t control, - int8_t value); - -/** - * Writes an unsigned 8-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU8(NiFpga_Session session, - uint32_t control, - uint8_t value); - -/** - * Writes a signed 16-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI16(NiFpga_Session session, - uint32_t control, - int16_t value); - -/** - * Writes an unsigned 16-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU16(NiFpga_Session session, - uint32_t control, - uint16_t value); - -/** - * Writes a signed 32-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI32(NiFpga_Session session, - uint32_t control, - int32_t value); - -/** - * Writes an unsigned 32-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU32(NiFpga_Session session, - uint32_t control, - uint32_t value); - -/** - * Writes a signed 64-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteI64(NiFpga_Session session, - uint32_t control, - int64_t value); - -/** - * Writes an unsigned 64-bit integer value to a given control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param value value to write - * @return result of the call - */ -NiFpga_Status NiFpga_WriteU64(NiFpga_Session session, - uint32_t control, - uint64_t value); - -/** - * Reads an entire array of boolean values from a given array indicator or - * control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayBool(NiFpga_Session session, - uint32_t indicator, - NiFpga_Bool* array, - size_t size); - -/** - * Reads an entire array of signed 8-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI8(NiFpga_Session session, - uint32_t indicator, - int8_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 8-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU8(NiFpga_Session session, - uint32_t indicator, - uint8_t* array, - size_t size); - -/** - * Reads an entire array of signed 16-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI16(NiFpga_Session session, - uint32_t indicator, - int16_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 16-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU16(NiFpga_Session session, - uint32_t indicator, - uint16_t* array, - size_t size); - -/** - * Reads an entire array of signed 32-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI32(NiFpga_Session session, - uint32_t indicator, - int32_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 32-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU32(NiFpga_Session session, - uint32_t indicator, - uint32_t* array, - size_t size); - -/** - * Reads an entire array of signed 64-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayI64(NiFpga_Session session, - uint32_t indicator, - int64_t* array, - size_t size); - -/** - * Reads an entire array of unsigned 64-bit integer values from a given array - * indicator or control. - * - * @warning The size passed must be the exact number of elements in the - * indicator or control. - * - * @param session handle to a currently open session - * @param indicator indicator or control from which to read - * @param array outputs the entire array that was read - * @param size exact number of elements in the indicator or control - * @return result of the call - */ -NiFpga_Status NiFpga_ReadArrayU64(NiFpga_Session session, - uint32_t indicator, - uint64_t* array, - size_t size); - -/** - * Writes an entire array of boolean values to a given array control or - * indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayBool(NiFpga_Session session, - uint32_t control, - const NiFpga_Bool* array, - size_t size); - -/** - * Writes an entire array of signed 8-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI8(NiFpga_Session session, - uint32_t control, - const int8_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 8-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU8(NiFpga_Session session, - uint32_t control, - const uint8_t* array, - size_t size); - -/** - * Writes an entire array of signed 16-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI16(NiFpga_Session session, - uint32_t control, - const int16_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 16-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU16(NiFpga_Session session, - uint32_t control, - const uint16_t* array, - size_t size); - -/** - * Writes an entire array of signed 32-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI32(NiFpga_Session session, - uint32_t control, - const int32_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 32-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU32(NiFpga_Session session, - uint32_t control, - const uint32_t* array, - size_t size); - -/** - * Writes an entire array of signed 64-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayI64(NiFpga_Session session, - uint32_t control, - const int64_t* array, - size_t size); - -/** - * Writes an entire array of unsigned 64-bit integer values to a given array - * control or indicator. - * - * @warning The size passed must be the exact number of elements in the - * control or indicator. - * - * @param session handle to a currently open session - * @param control control or indicator to which to write - * @param array entire array to write - * @param size exact number of elements in the control or indicator - * @return result of the call - */ -NiFpga_Status NiFpga_WriteArrayU64(NiFpga_Session session, - uint32_t control, - const uint64_t* array, - size_t size); - -/** - * Enumeration of all 32 possible IRQs. Multiple IRQs can be bitwise ORed - * together like this: - * - * NiFpga_Irq_3 | NiFpga_Irq_23 - */ -typedef enum -{ - NiFpga_Irq_0 = 1 << 0, - NiFpga_Irq_1 = 1 << 1, - NiFpga_Irq_2 = 1 << 2, - NiFpga_Irq_3 = 1 << 3, - NiFpga_Irq_4 = 1 << 4, - NiFpga_Irq_5 = 1 << 5, - NiFpga_Irq_6 = 1 << 6, - NiFpga_Irq_7 = 1 << 7, - NiFpga_Irq_8 = 1 << 8, - NiFpga_Irq_9 = 1 << 9, - NiFpga_Irq_10 = 1 << 10, - NiFpga_Irq_11 = 1 << 11, - NiFpga_Irq_12 = 1 << 12, - NiFpga_Irq_13 = 1 << 13, - NiFpga_Irq_14 = 1 << 14, - NiFpga_Irq_15 = 1 << 15, - NiFpga_Irq_16 = 1 << 16, - NiFpga_Irq_17 = 1 << 17, - NiFpga_Irq_18 = 1 << 18, - NiFpga_Irq_19 = 1 << 19, - NiFpga_Irq_20 = 1 << 20, - NiFpga_Irq_21 = 1 << 21, - NiFpga_Irq_22 = 1 << 22, - NiFpga_Irq_23 = 1 << 23, - NiFpga_Irq_24 = 1 << 24, - NiFpga_Irq_25 = 1 << 25, - NiFpga_Irq_26 = 1 << 26, - NiFpga_Irq_27 = 1 << 27, - NiFpga_Irq_28 = 1 << 28, - NiFpga_Irq_29 = 1 << 29, - NiFpga_Irq_30 = 1 << 30, - NiFpga_Irq_31 = 1U << 31 -} NiFpga_Irq; - -/** - * Represents an infinite timeout. - */ -static const uint32_t NiFpga_InfiniteTimeout = 0xFFFFFFFF; - -/** - * See NiFpga_ReserveIrqContext for more information. - */ -typedef void* NiFpga_IrqContext; - -/** - * IRQ contexts are single-threaded; only one thread can wait with a particular - * context at any given time. Clients must reserve as many contexts as the - * application requires. - * - * If a context is successfully reserved (the returned status is not an error), - * it must be unreserved later. Otherwise a memory leak will occur. - * - * @param session handle to a currently open session - * @param context outputs the IRQ context - * @return result of the call - */ -NiFpga_Status NiFpga_ReserveIrqContext(NiFpga_Session session, - NiFpga_IrqContext* context); - -/** - * Unreserves an IRQ context obtained from NiFpga_ReserveIrqContext. - * - * @param session handle to a currently open session - * @param context IRQ context to unreserve - * @return result of the call - */ -NiFpga_Status NiFpga_UnreserveIrqContext(NiFpga_Session session, - NiFpga_IrqContext context); - -/** - * This is a blocking function that stops the calling thread until the FPGA - * asserts any IRQ in the irqs parameter, or until the function call times out. - * Before calling this function, you must use NiFpga_ReserveIrqContext to - * reserve an IRQ context. No other threads can use the same context when this - * function is called. - * - * You can use the irqsAsserted parameter to determine which IRQs were asserted - * for each function call. - * - * @param session handle to a currently open session - * @param context IRQ context with which to wait - * @param irqs bitwise OR of NiFpga_Irqs - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param irqsAsserted if non-NULL, outputs bitwise OR of IRQs that were - * asserted - * @param timedOut if non-NULL, outputs whether the timeout expired - * @return result of the call - */ -NiFpga_Status NiFpga_WaitOnIrqs(NiFpga_Session session, - NiFpga_IrqContext context, - uint32_t irqs, - uint32_t timeout, - uint32_t* irqsAsserted, - NiFpga_Bool* timedOut); - -/** - * Acknowledges an IRQ or set of IRQs. - * - * @param session handle to a currently open session - * @param irqs bitwise OR of NiFpga_Irqs - * @return result of the call - */ -NiFpga_Status NiFpga_AcknowledgeIrqs(NiFpga_Session session, - uint32_t irqs); - -/** - * Specifies the depth of the host memory part of the DMA FIFO. This method is - * optional. In order to see the actual depth configured, use - * NiFpga_ConfigureFifo2. - * - * @param session handle to a currently open session - * @param fifo FIFO to configure - * @param depth requested number of elements in the host memory part of the - * DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ConfigureFifo(NiFpga_Session session, - uint32_t fifo, - size_t depth); - -/** - * Specifies the depth of the host memory part of the DMA FIFO. This method is - * optional. - * - * @param session handle to a currently open session - * @param fifo FIFO to configure - * @param requestedDepth requested number of elements in the host memory part - * of the DMA FIFO - * @param actualDepth if non-NULL, outputs the actual number of elements in the - * host memory part of the DMA FIFO, which may be more than - * the requested number - * @return result of the call - */ -NiFpga_Status NiFpga_ConfigureFifo2(NiFpga_Session session, - uint32_t fifo, - size_t requestedDepth, - size_t* actualDepth); -/** - * Starts a FIFO. This method is optional. - * - * @param session handle to a currently open session - * @param fifo FIFO to start - * @return result of the call - */ -NiFpga_Status NiFpga_StartFifo(NiFpga_Session session, - uint32_t fifo); - -/** - * Stops a FIFO. This method is optional. - * - * @param session handle to a currently open session - * @param fifo FIFO to stop - * @return result of the call - */ -NiFpga_Status NiFpga_StopFifo(NiFpga_Session session, - uint32_t fifo); - -/** - * Reads from a target-to-host FIFO of booleans. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoBool(NiFpga_Session session, - uint32_t fifo, - NiFpga_Bool* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI8(NiFpga_Session session, - uint32_t fifo, - int8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU8(NiFpga_Session session, - uint32_t fifo, - uint8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI16(NiFpga_Session session, - uint32_t fifo, - int16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU16(NiFpga_Session session, - uint32_t fifo, - uint16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI32(NiFpga_Session session, - uint32_t fifo, - int32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU32(NiFpga_Session session, - uint32_t fifo, - uint32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of signed 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoI64(NiFpga_Session session, - uint32_t fifo, - int64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Reads from a target-to-host FIFO of unsigned 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param data outputs the data that was read - * @param numberOfElements number of elements to read - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_ReadFifoU64(NiFpga_Session session, - uint32_t fifo, - uint64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* elementsRemaining); - -/** - * Writes to a host-to-target FIFO of booleans. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoBool(NiFpga_Session session, - uint32_t fifo, - const NiFpga_Bool* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI8(NiFpga_Session session, - uint32_t fifo, - const int8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 8-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU8(NiFpga_Session session, - uint32_t fifo, - const uint8_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI16(NiFpga_Session session, - uint32_t fifo, - const int16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 16-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU16(NiFpga_Session session, - uint32_t fifo, - const uint16_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI32(NiFpga_Session session, - uint32_t fifo, - const int32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 32-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU32(NiFpga_Session session, - uint32_t fifo, - const uint32_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of signed 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoI64(NiFpga_Session session, - uint32_t fifo, - const int64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Writes to a host-to-target FIFO of unsigned 64-bit integers. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param data data to write - * @param numberOfElements number of elements to write - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param emptyElementsRemaining if non-NULL, outputs the number of empty - * elements remaining in the host memory part of - * the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_WriteFifoU64(NiFpga_Session session, - uint32_t fifo, - const uint64_t* data, - size_t numberOfElements, - uint32_t timeout, - size_t* emptyElementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of booleans. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsBool( - NiFpga_Session session, - uint32_t fifo, - NiFpga_Bool** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 8-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI8( - NiFpga_Session session, - uint32_t fifo, - int8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 8-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU8( - NiFpga_Session session, - uint32_t fifo, - uint8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 16-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI16( - NiFpga_Session session, - uint32_t fifo, - int16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 16-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU16( - NiFpga_Session session, - uint32_t fifo, - uint16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 32-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI32( - NiFpga_Session session, - uint32_t fifo, - int32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 32-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU32( - NiFpga_Session session, - uint32_t fifo, - uint32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of signed 64-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsI64( - NiFpga_Session session, - uint32_t fifo, - int64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for reading from a target-to-host FIFO of unsigned 64-bit - * integers. - * - * Acquiring, reading, and releasing FIFO elements prevents the need to copy - * the contents of elements from the host memory buffer to a separate - * user-allocated buffer before reading. The FPGA target cannot write to - * elements acquired by the host. Therefore, the host must release elements - * after reading them. The number of elements acquired may differ from the - * number of elements requested if, for example, the number of elements - * requested reaches the end of the host memory buffer. Always release all - * acquired elements before closing the session. Do not attempt to access FIFO - * elements after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo target-to-host FIFO from which to read - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoReadElementsU64( - NiFpga_Session session, - uint32_t fifo, - uint64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of booleans. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsBool( - NiFpga_Session session, - uint32_t fifo, - NiFpga_Bool** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 8-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI8( - NiFpga_Session session, - uint32_t fifo, - int8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 8-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU8( - NiFpga_Session session, - uint32_t fifo, - uint8_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 16-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI16( - NiFpga_Session session, - uint32_t fifo, - int16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 16-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU16( - NiFpga_Session session, - uint32_t fifo, - uint16_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 32-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI32( - NiFpga_Session session, - uint32_t fifo, - int32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 32-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU32( - NiFpga_Session session, - uint32_t fifo, - uint32_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of signed 64-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsI64( - NiFpga_Session session, - uint32_t fifo, - int64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Acquires elements for writing to a host-to-target FIFO of unsigned 64-bit - * integers. - * - * Acquiring, writing, and releasing FIFO elements prevents the need to write - * first into a separate user-allocated buffer and then copy the contents of - * elements to the host memory buffer. The FPGA target cannot read elements - * acquired by the host. Therefore, the host must release elements after - * writing to them. The number of elements acquired may differ from the number - * of elements requested if, for example, the number of elements requested - * reaches the end of the host memory buffer. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo host-to-target FIFO to which to write - * @param elements outputs a pointer to the elements acquired - * @param elementsRequested reqested number of elements - * @param timeout timeout in milliseconds, or NiFpga_InfiniteTimeout - * @param elementsAcquired actual number of elements acquired, which may be - * less than the requested number - * @param elementsRemaining if non-NULL, outputs the number of elements - * remaining in the host memory part of the DMA FIFO - * @return result of the call - */ -NiFpga_Status NiFpga_AcquireFifoWriteElementsU64( - NiFpga_Session session, - uint32_t fifo, - uint64_t** elements, - size_t elementsRequested, - uint32_t timeout, - size_t* elementsAcquired, - size_t* elementsRemaining); - -/** - * Releases previously acquired FIFO elements. - * - * The FPGA target cannot read elements acquired by the host. Therefore, the - * host must release elements after acquiring them. Always release all acquired - * elements before closing the session. Do not attempt to access FIFO elements - * after the elements are released or the session is closed. - * - * @param session handle to a currently open session - * @param fifo FIFO from which to release elements - * @param elements number of elements to release - * @return result of the call - */ -NiFpga_Status NiFpga_ReleaseFifoElements(NiFpga_Session session, - uint32_t fifo, - size_t elements); - -/** - * Gets an endpoint reference to a peer-to-peer FIFO. - * - * @param session handle to a currently open session - * @param fifo peer-to-peer FIFO - * @param endpoint outputs the endpoint reference - * @return result of the call - */ -NiFpga_Status NiFpga_GetPeerToPeerFifoEndpoint(NiFpga_Session session, - uint32_t fifo, - uint32_t* endpoint); - -#if NiFpga_Cpp -} -#endif - -#endif diff --git a/hal/Azalea/src/main/native/ChipObject/NiRio.h b/hal/Azalea/src/main/native/ChipObject/NiRio.h deleted file mode 100644 index c0dc29ec35..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/NiRio.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __NiRio_h__ -#define __NiRio_h__ - -#include "NiFpga.h" -typedef NiFpga_Status tRioStatusCode; - -#endif // __NiRio_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/nInterfaceGlobals.h b/hal/Azalea/src/main/native/ChipObject/nInterfaceGlobals.h deleted file mode 100644 index b6c366cf9c..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/nInterfaceGlobals.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_nInterfaceGlobals_h__ -#define __nFRC_2012_1_6_4_nInterfaceGlobals_h__ - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - extern unsigned int g_currentTargetClass; -} -} - -#endif // __nFRC_2012_1_6_4_nInterfaceGlobals_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tAI.h b/hal/Azalea/src/main/native/ChipObject/tAI.h deleted file mode 100644 index 38b3f8edb8..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tAI.h +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_AI_h__ -#define __nFRC_2012_1_6_4_AI_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAI -{ -public: - tAI(){} - virtual ~tAI(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAI* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 2, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned Channel : 3; - unsigned Module : 1; - unsigned Averaged : 1; - }; - struct{ - unsigned value : 5; - }; - } tReadSelect; - typedef - union{ - struct{ - unsigned ScanSize : 3; - unsigned ConvertRate : 26; - }; - struct{ - unsigned value : 29; - }; - } tConfig; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_ScanSize(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ConvertRate(unsigned int value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ScanSize(tRioStatusCode *status) = 0; - virtual unsigned int readConfig_ConvertRate(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumScanListElements = 8, - } tScanList_IfaceConstants; - - virtual void writeScanList(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readScanList(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - } tLoopTiming_IfaceConstants; - - virtual unsigned int readLoopTiming(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumAverageBitsElements = 8, - } tAverageBits_IfaceConstants; - - virtual void writeAverageBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readAverageBits(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - kNumOversampleBitsElements = 8, - } tOversampleBits_IfaceConstants; - - virtual void writeOversampleBits(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readOversampleBits(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual signed int readOutput(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReadSelect_IfaceConstants; - - virtual void writeReadSelect(tReadSelect value, tRioStatusCode *status) = 0; - virtual void writeReadSelect_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeReadSelect_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeReadSelect_Averaged(bool value, tRioStatusCode *status) = 0; - virtual tReadSelect readReadSelect(tRioStatusCode *status) = 0; - virtual unsigned char readReadSelect_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readReadSelect_Module(tRioStatusCode *status) = 0; - virtual bool readReadSelect_Averaged(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLatchOutput_IfaceConstants; - - virtual void strobeLatchOutput(tRioStatusCode *status) = 0; - - - - -private: - tAI(const tAI&); - void operator=(const tAI&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_AI_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tAccumulator.h b/hal/Azalea/src/main/native/ChipObject/tAccumulator.h deleted file mode 100644 index 370848cb2b..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tAccumulator.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Accumulator_h__ -#define __nFRC_2012_1_6_4_Accumulator_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAccumulator -{ -public: - tAccumulator(){} - virtual ~tAccumulator(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAccumulator* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 2, - } tIfaceConstants; - - typedef - union{ - struct{ - signed long long Value; - unsigned Count : 32; - }; - struct{ - unsigned value : 32; - unsigned value2 : 32; - unsigned value3 : 32; - }; - } tOutput; - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual tOutput readOutput(tRioStatusCode *status) = 0; - virtual signed long long readOutput_Value(tRioStatusCode *status) = 0; - virtual unsigned int readOutput_Count(tRioStatusCode *status) = 0; - - - typedef enum - { - } tCenter_IfaceConstants; - - virtual void writeCenter(signed int value, tRioStatusCode *status) = 0; - virtual signed int readCenter(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDeadband_IfaceConstants; - - virtual void writeDeadband(signed int value, tRioStatusCode *status) = 0; - virtual signed int readDeadband(tRioStatusCode *status) = 0; - - - - - -private: - tAccumulator(const tAccumulator&); - void operator=(const tAccumulator&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Accumulator_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tAlarm.h b/hal/Azalea/src/main/native/ChipObject/tAlarm.h deleted file mode 100644 index 2e542a2ff1..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tAlarm.h +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Alarm_h__ -#define __nFRC_2012_1_6_4_Alarm_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAlarm -{ -public: - tAlarm(){} - virtual ~tAlarm(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAlarm* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - } tTriggerTime_IfaceConstants; - - virtual void writeTriggerTime(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readTriggerTime(tRioStatusCode *status) = 0; - - - typedef enum - { - } tEnable_IfaceConstants; - - virtual void writeEnable(bool value, tRioStatusCode *status) = 0; - virtual bool readEnable(tRioStatusCode *status) = 0; - - - - -private: - tAlarm(const tAlarm&); - void operator=(const tAlarm&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Alarm_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tAnalogTrigger.h b/hal/Azalea/src/main/native/ChipObject/tAnalogTrigger.h deleted file mode 100644 index a05f19dcd2..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tAnalogTrigger.h +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_AnalogTrigger_h__ -#define __nFRC_2012_1_6_4_AnalogTrigger_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tAnalogTrigger -{ -public: - tAnalogTrigger(){} - virtual ~tAnalogTrigger(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tAnalogTrigger* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 8, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned InHysteresis : 1; - unsigned OverLimit : 1; - unsigned Rising : 1; - unsigned Falling : 1; - }; - struct{ - unsigned value : 4; - }; - } tOutput; - typedef - union{ - struct{ - unsigned Channel : 3; - unsigned Module : 1; - unsigned Averaged : 1; - unsigned Filter : 1; - unsigned FloatingRollover : 1; - signed RolloverLimit : 8; - }; - struct{ - unsigned value : 15; - }; - } tSourceSelect; - - - typedef enum - { - } tSourceSelect_IfaceConstants; - - virtual void writeSourceSelect(tSourceSelect value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Averaged(bool value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_Filter(bool value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_FloatingRollover(bool value, tRioStatusCode *status) = 0; - virtual void writeSourceSelect_RolloverLimit(signed short value, tRioStatusCode *status) = 0; - virtual tSourceSelect readSourceSelect(tRioStatusCode *status) = 0; - virtual unsigned char readSourceSelect_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readSourceSelect_Module(tRioStatusCode *status) = 0; - virtual bool readSourceSelect_Averaged(tRioStatusCode *status) = 0; - virtual bool readSourceSelect_Filter(tRioStatusCode *status) = 0; - virtual bool readSourceSelect_FloatingRollover(tRioStatusCode *status) = 0; - virtual signed short readSourceSelect_RolloverLimit(tRioStatusCode *status) = 0; - - - typedef enum - { - } tUpperLimit_IfaceConstants; - - virtual void writeUpperLimit(signed int value, tRioStatusCode *status) = 0; - virtual signed int readUpperLimit(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLowerLimit_IfaceConstants; - - virtual void writeLowerLimit(signed int value, tRioStatusCode *status) = 0; - virtual signed int readLowerLimit(tRioStatusCode *status) = 0; - - - - typedef enum - { - kNumOutputElements = 8, - } tOutput_IfaceConstants; - - virtual tOutput readOutput(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_InHysteresis(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_OverLimit(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_Rising(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readOutput_Falling(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - -private: - tAnalogTrigger(const tAnalogTrigger&); - void operator=(const tAnalogTrigger&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_AnalogTrigger_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tCounter.h b/hal/Azalea/src/main/native/ChipObject/tCounter.h deleted file mode 100644 index 83d409b867..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tCounter.h +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Counter_h__ -#define __nFRC_2012_1_6_4_Counter_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tCounter -{ -public: - tCounter(){} - virtual ~tCounter(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tCounter* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 8, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned Direction : 1; - signed Value : 31; - }; - struct{ - unsigned value : 32; - }; - } tOutput; - typedef - union{ - struct{ - unsigned UpSource_Channel : 4; - unsigned UpSource_Module : 1; - unsigned UpSource_AnalogTrigger : 1; - unsigned DownSource_Channel : 4; - unsigned DownSource_Module : 1; - unsigned DownSource_AnalogTrigger : 1; - unsigned IndexSource_Channel : 4; - unsigned IndexSource_Module : 1; - unsigned IndexSource_AnalogTrigger : 1; - unsigned IndexActiveHigh : 1; - unsigned UpRisingEdge : 1; - unsigned UpFallingEdge : 1; - unsigned DownRisingEdge : 1; - unsigned DownFallingEdge : 1; - unsigned Mode : 2; - unsigned PulseLengthThreshold : 6; - unsigned Enable : 1; - }; - struct{ - unsigned value : 32; - }; - } tConfig; - typedef - union{ - struct{ - unsigned Period : 23; - signed Count : 8; - unsigned Stalled : 1; - }; - struct{ - unsigned value : 32; - }; - } tTimerOutput; - typedef - union{ - struct{ - unsigned StallPeriod : 24; - unsigned AverageSize : 7; - unsigned UpdateWhenEmpty : 1; - }; - struct{ - unsigned value : 32; - }; - } tTimerConfig; - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual tOutput readOutput(tRioStatusCode *status) = 0; - virtual bool readOutput_Direction(tRioStatusCode *status) = 0; - virtual signed int readOutput_Value(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpRisingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_UpFallingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownRisingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DownFallingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Mode(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_PulseLengthThreshold(unsigned short value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_UpSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_UpSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_UpSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_DownSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_DownSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_DownSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0; - virtual bool readConfig_UpRisingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_UpFallingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_DownRisingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_DownFallingEdge(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_Mode(tRioStatusCode *status) = 0; - virtual unsigned short readConfig_PulseLengthThreshold(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerOutput_IfaceConstants; - - virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0; - virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0; - virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0; - virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerConfig_IfaceConstants; - - virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0; - virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0; - virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0; - virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0; - virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0; - - - - - -private: - tCounter(const tCounter&); - void operator=(const tCounter&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Counter_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tDIO.h b/hal/Azalea/src/main/native/ChipObject/tDIO.h deleted file mode 100644 index 909e72c96e..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tDIO.h +++ /dev/null @@ -1,296 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_DIO_h__ -#define __nFRC_2012_1_6_4_DIO_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tDIO -{ -public: - tDIO(){} - virtual ~tDIO(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tDIO* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 2, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned Period : 16; - unsigned MinHigh : 16; - }; - struct{ - unsigned value : 32; - }; - } tPWMConfig; - typedef - union{ - struct{ - unsigned RelayFwd : 8; - unsigned RelayRev : 8; - unsigned I2CHeader : 4; - }; - struct{ - unsigned value : 20; - }; - } tSlowValue; - typedef - union{ - struct{ - unsigned Transaction : 1; - unsigned Done : 1; - unsigned Aborted : 1; - unsigned DataReceivedHigh : 24; - }; - struct{ - unsigned value : 27; - }; - } tI2CStatus; - typedef - union{ - struct{ - unsigned PeriodPower : 4; - unsigned OutputSelect_0 : 4; - unsigned OutputSelect_1 : 4; - unsigned OutputSelect_2 : 4; - unsigned OutputSelect_3 : 4; - }; - struct{ - unsigned value : 20; - }; - } tDO_PWMConfig; - typedef - union{ - struct{ - unsigned Address : 8; - unsigned BytesToRead : 3; - unsigned BytesToWrite : 3; - unsigned DataToSendHigh : 16; - unsigned BitwiseHandshake : 1; - }; - struct{ - unsigned value : 31; - }; - } tI2CConfig; - - - typedef enum - { - } tI2CDataToSend_IfaceConstants; - - virtual void writeI2CDataToSend(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readI2CDataToSend(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDO_IfaceConstants; - - virtual void writeDO(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readDO(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumFilterSelectElements = 16, - } tFilterSelect_IfaceConstants; - - virtual void writeFilterSelect(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readFilterSelect(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - kNumFilterPeriodElements = 3, - } tFilterPeriod_IfaceConstants; - - virtual void writeFilterPeriod(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readFilterPeriod(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - } tOutputEnable_IfaceConstants; - - virtual void writeOutputEnable(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readOutputEnable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tSlowValue_IfaceConstants; - - virtual void writeSlowValue(tSlowValue value, tRioStatusCode *status) = 0; - virtual void writeSlowValue_RelayFwd(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSlowValue_RelayRev(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeSlowValue_I2CHeader(unsigned char value, tRioStatusCode *status) = 0; - virtual tSlowValue readSlowValue(tRioStatusCode *status) = 0; - virtual unsigned char readSlowValue_RelayFwd(tRioStatusCode *status) = 0; - virtual unsigned char readSlowValue_RelayRev(tRioStatusCode *status) = 0; - virtual unsigned char readSlowValue_I2CHeader(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CStatus_IfaceConstants; - - virtual tI2CStatus readI2CStatus(tRioStatusCode *status) = 0; - virtual unsigned char readI2CStatus_Transaction(tRioStatusCode *status) = 0; - virtual bool readI2CStatus_Done(tRioStatusCode *status) = 0; - virtual bool readI2CStatus_Aborted(tRioStatusCode *status) = 0; - virtual unsigned int readI2CStatus_DataReceivedHigh(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CDataReceived_IfaceConstants; - - virtual unsigned int readI2CDataReceived(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDI_IfaceConstants; - - virtual unsigned short readDI(tRioStatusCode *status) = 0; - - - typedef enum - { - } tPulse_IfaceConstants; - - virtual void writePulse(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readPulse(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumPWMPeriodScaleElements = 10, - } tPWMPeriodScale_IfaceConstants; - - virtual void writePWMPeriodScale(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPWMPeriodScale(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - kNumDO_PWMDutyCycleElements = 4, - } tDO_PWMDutyCycle_IfaceConstants; - - virtual void writeDO_PWMDutyCycle(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMDutyCycle(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - typedef enum - { - } tBFL_IfaceConstants; - - virtual void writeBFL(bool value, tRioStatusCode *status) = 0; - virtual bool readBFL(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CStart_IfaceConstants; - - virtual void strobeI2CStart(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDO_PWMConfig_IfaceConstants; - - virtual void writeDO_PWMConfig(tDO_PWMConfig value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_PeriodPower(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_0(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_1(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_2(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeDO_PWMConfig_OutputSelect_3(unsigned char value, tRioStatusCode *status) = 0; - virtual tDO_PWMConfig readDO_PWMConfig(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_PeriodPower(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_0(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_1(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_2(tRioStatusCode *status) = 0; - virtual unsigned char readDO_PWMConfig_OutputSelect_3(tRioStatusCode *status) = 0; - - - typedef enum - { - } tPulseLength_IfaceConstants; - - virtual void writePulseLength(unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPulseLength(tRioStatusCode *status) = 0; - - - typedef enum - { - } tI2CConfig_IfaceConstants; - - virtual void writeI2CConfig(tI2CConfig value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_Address(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_BytesToRead(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_BytesToWrite(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_DataToSendHigh(unsigned short value, tRioStatusCode *status) = 0; - virtual void writeI2CConfig_BitwiseHandshake(bool value, tRioStatusCode *status) = 0; - virtual tI2CConfig readI2CConfig(tRioStatusCode *status) = 0; - virtual unsigned char readI2CConfig_Address(tRioStatusCode *status) = 0; - virtual unsigned char readI2CConfig_BytesToRead(tRioStatusCode *status) = 0; - virtual unsigned char readI2CConfig_BytesToWrite(tRioStatusCode *status) = 0; - virtual unsigned short readI2CConfig_DataToSendHigh(tRioStatusCode *status) = 0; - virtual bool readI2CConfig_BitwiseHandshake(tRioStatusCode *status) = 0; - - - - typedef enum - { - } tLoopTiming_IfaceConstants; - - virtual unsigned short readLoopTiming(tRioStatusCode *status) = 0; - - - typedef enum - { - } tPWMConfig_IfaceConstants; - - virtual void writePWMConfig(tPWMConfig value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_Period(unsigned short value, tRioStatusCode *status) = 0; - virtual void writePWMConfig_MinHigh(unsigned short value, tRioStatusCode *status) = 0; - virtual tPWMConfig readPWMConfig(tRioStatusCode *status) = 0; - virtual unsigned short readPWMConfig_Period(tRioStatusCode *status) = 0; - virtual unsigned short readPWMConfig_MinHigh(tRioStatusCode *status) = 0; - - - - typedef enum - { - kNumPWMValueRegisters = 10, - } tPWMValue_IfaceConstants; - - virtual void writePWMValue(unsigned char reg_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readPWMValue(unsigned char reg_index, tRioStatusCode *status) = 0; - - - -private: - tDIO(const tDIO&); - void operator=(const tDIO&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_DIO_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tDMA.h b/hal/Azalea/src/main/native/ChipObject/tDMA.h deleted file mode 100644 index 68fbb92740..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tDMA.h +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_DMA_h__ -#define __nFRC_2012_1_6_4_DMA_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tDMA -{ -public: - tDMA(){} - virtual ~tDMA(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tDMA* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned Pause : 1; - unsigned Enable_AI0_Low : 1; - unsigned Enable_AI0_High : 1; - unsigned Enable_AIAveraged0_Low : 1; - unsigned Enable_AIAveraged0_High : 1; - unsigned Enable_AI1_Low : 1; - unsigned Enable_AI1_High : 1; - unsigned Enable_AIAveraged1_Low : 1; - unsigned Enable_AIAveraged1_High : 1; - unsigned Enable_Accumulator0 : 1; - unsigned Enable_Accumulator1 : 1; - unsigned Enable_DI : 1; - unsigned Enable_AnalogTriggers : 1; - unsigned Enable_Counters_Low : 1; - unsigned Enable_Counters_High : 1; - unsigned Enable_CounterTimers_Low : 1; - unsigned Enable_CounterTimers_High : 1; - unsigned Enable_Encoders : 1; - unsigned Enable_EncoderTimers : 1; - unsigned ExternalClock : 1; - }; - struct{ - unsigned value : 20; - }; - } tConfig; - typedef - union{ - struct{ - unsigned ExternalClockSource_Channel : 4; - unsigned ExternalClockSource_Module : 1; - unsigned ExternalClockSource_AnalogTrigger : 1; - unsigned RisingEdge : 1; - unsigned FallingEdge : 1; - }; - struct{ - unsigned value : 8; - }; - } tExternalTriggers; - - - - typedef enum - { - } tRate_IfaceConstants; - - virtual void writeRate(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readRate(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_Pause(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI0_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI0_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged0_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged0_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI1_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AI1_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged1_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AIAveraged1_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Accumulator0(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Accumulator1(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_DI(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_AnalogTriggers(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Counters_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Counters_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_CounterTimers_Low(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_CounterTimers_High(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_Encoders(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable_EncoderTimers(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_ExternalClock(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual bool readConfig_Pause(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI0_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI0_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged0_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged0_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI1_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AI1_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged1_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AIAveraged1_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Accumulator0(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Accumulator1(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_DI(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_AnalogTriggers(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Counters_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Counters_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_CounterTimers_Low(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_CounterTimers_High(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_Encoders(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable_EncoderTimers(tRioStatusCode *status) = 0; - virtual bool readConfig_ExternalClock(tRioStatusCode *status) = 0; - - - typedef enum - { - kNumExternalTriggersElements = 4, - } tExternalTriggers_IfaceConstants; - - virtual void writeExternalTriggers(unsigned char bitfield_index, tExternalTriggers value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_ExternalClockSource_Channel(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_ExternalClockSource_Module(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_RisingEdge(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0; - virtual void writeExternalTriggers_FallingEdge(unsigned char bitfield_index, bool value, tRioStatusCode *status) = 0; - virtual tExternalTriggers readExternalTriggers(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual unsigned char readExternalTriggers_ExternalClockSource_Channel(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual unsigned char readExternalTriggers_ExternalClockSource_Module(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readExternalTriggers_ExternalClockSource_AnalogTrigger(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readExternalTriggers_RisingEdge(unsigned char bitfield_index, tRioStatusCode *status) = 0; - virtual bool readExternalTriggers_FallingEdge(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - -private: - tDMA(const tDMA&); - void operator=(const tDMA&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_DMA_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tDMAManager.h b/hal/Azalea/src/main/native/ChipObject/tDMAManager.h deleted file mode 100644 index edc774a25a..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tDMAManager.h +++ /dev/null @@ -1,47 +0,0 @@ -// Class for handling DMA transters. -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tDMAManager_h__ -#define __tDMAManager_h__ - -#include "NiRio.h" -#include "tSystem.h" - -namespace nFPGA -{ -// TODO: Implement DMA Manager -/* -class tDMAManager : public tSystem -{ -public: - tDMAManager(tNIRIO_u32 dmaChannel, tNIRIO_u32 hostBufferSize, tRioStatusCode *status); - ~tDMAManager(); - void start(tRioStatusCode *status); - void stop(tRioStatusCode *status); - bool isStarted() {return _started;} - void read( - tNIRIO_u32* buf, - tNIRIO_u32 num, - tNIRIO_u32 timeout, - tNIRIO_u32* read, - tNIRIO_u32* remaining, - tRioStatusCode *status); - void write( - tNIRIO_u32* buf, - tNIRIO_u32 num, - tNIRIO_u32 timeout, - tNIRIO_u32* remaining, - tRioStatusCode *status); -private: - bool _started; - tNIRIO_u32 _dmaChannel; - tNIRIO_u32 _hostBufferSize; - tDMAChannelDescriptor const *_dmaChannelDescriptor; - -}; -*/ -} - - -#endif // __tDMAManager_h__ - diff --git a/hal/Azalea/src/main/native/ChipObject/tEncoder.h b/hal/Azalea/src/main/native/ChipObject/tEncoder.h deleted file mode 100644 index 53a770a56a..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tEncoder.h +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Encoder_h__ -#define __nFRC_2012_1_6_4_Encoder_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tEncoder -{ -public: - tEncoder(){} - virtual ~tEncoder(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tEncoder* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 4, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned Direction : 1; - signed Value : 31; - }; - struct{ - unsigned value : 32; - }; - } tOutput; - typedef - union{ - struct{ - unsigned ASource_Channel : 4; - unsigned ASource_Module : 1; - unsigned ASource_AnalogTrigger : 1; - unsigned BSource_Channel : 4; - unsigned BSource_Module : 1; - unsigned BSource_AnalogTrigger : 1; - unsigned IndexSource_Channel : 4; - unsigned IndexSource_Module : 1; - unsigned IndexSource_AnalogTrigger : 1; - unsigned IndexActiveHigh : 1; - unsigned Reverse : 1; - unsigned Enable : 1; - }; - struct{ - unsigned value : 21; - }; - } tConfig; - typedef - union{ - struct{ - unsigned Period : 23; - signed Count : 8; - unsigned Stalled : 1; - }; - struct{ - unsigned value : 32; - }; - } tTimerOutput; - typedef - union{ - struct{ - unsigned StallPeriod : 24; - unsigned AverageSize : 7; - unsigned UpdateWhenEmpty : 1; - }; - struct{ - unsigned value : 32; - }; - } tTimerConfig; - - - typedef enum - { - } tOutput_IfaceConstants; - - virtual tOutput readOutput(tRioStatusCode *status) = 0; - virtual bool readOutput_Direction(tRioStatusCode *status) = 0; - virtual signed int readOutput_Value(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_ASource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ASource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ASource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_BSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_BSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_BSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexSource_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_IndexActiveHigh(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Reverse(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_Enable(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ASource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ASource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_ASource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_BSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_BSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_BSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_IndexSource_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexSource_AnalogTrigger(tRioStatusCode *status) = 0; - virtual bool readConfig_IndexActiveHigh(tRioStatusCode *status) = 0; - virtual bool readConfig_Reverse(tRioStatusCode *status) = 0; - virtual bool readConfig_Enable(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerOutput_IfaceConstants; - - virtual tTimerOutput readTimerOutput(tRioStatusCode *status) = 0; - virtual unsigned int readTimerOutput_Period(tRioStatusCode *status) = 0; - virtual signed char readTimerOutput_Count(tRioStatusCode *status) = 0; - virtual bool readTimerOutput_Stalled(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimerConfig_IfaceConstants; - - virtual void writeTimerConfig(tTimerConfig value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_StallPeriod(unsigned int value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_AverageSize(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeTimerConfig_UpdateWhenEmpty(bool value, tRioStatusCode *status) = 0; - virtual tTimerConfig readTimerConfig(tRioStatusCode *status) = 0; - virtual unsigned int readTimerConfig_StallPeriod(tRioStatusCode *status) = 0; - virtual unsigned char readTimerConfig_AverageSize(tRioStatusCode *status) = 0; - virtual bool readTimerConfig_UpdateWhenEmpty(tRioStatusCode *status) = 0; - - - - - -private: - tEncoder(const tEncoder&); - void operator=(const tEncoder&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Encoder_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tGlobal.h b/hal/Azalea/src/main/native/ChipObject/tGlobal.h deleted file mode 100644 index 19faf8db5b..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tGlobal.h +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Global_h__ -#define __nFRC_2012_1_6_4_Global_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tGlobal -{ -public: - tGlobal(){} - virtual ~tGlobal(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tGlobal* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - } tVersion_IfaceConstants; - - virtual unsigned short readVersion(tRioStatusCode *status) = 0; - - - typedef enum - { - } tFPGA_LED_IfaceConstants; - - virtual void writeFPGA_LED(bool value, tRioStatusCode *status) = 0; - virtual bool readFPGA_LED(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLocalTime_IfaceConstants; - - virtual unsigned int readLocalTime(tRioStatusCode *status) = 0; - - - typedef enum - { - } tRevision_IfaceConstants; - - virtual unsigned int readRevision(tRioStatusCode *status) = 0; - - - - -private: - tGlobal(const tGlobal&); - void operator=(const tGlobal&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Global_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tInterrupt.h b/hal/Azalea/src/main/native/ChipObject/tInterrupt.h deleted file mode 100644 index 319591d186..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tInterrupt.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Interrupt_h__ -#define __nFRC_2012_1_6_4_Interrupt_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tInterrupt -{ -public: - tInterrupt(){} - virtual ~tInterrupt(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tInterrupt* create(unsigned char sys_index, tRioStatusCode *status); - virtual unsigned char getSystemIndex() = 0; - - - typedef enum - { - kNumSystems = 8, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned Source_Channel : 4; - unsigned Source_Module : 1; - unsigned Source_AnalogTrigger : 1; - unsigned RisingEdge : 1; - unsigned FallingEdge : 1; - unsigned WaitForAck : 1; - }; - struct{ - unsigned value : 9; - }; - } tConfig; - - - typedef enum - { - } tTimeStamp_IfaceConstants; - - virtual unsigned int readTimeStamp(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_Source_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_Source_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_Source_AnalogTrigger(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_RisingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_FallingEdge(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_WaitForAck(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_Source_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_Source_Module(tRioStatusCode *status) = 0; - virtual bool readConfig_Source_AnalogTrigger(tRioStatusCode *status) = 0; - virtual bool readConfig_RisingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_FallingEdge(tRioStatusCode *status) = 0; - virtual bool readConfig_WaitForAck(tRioStatusCode *status) = 0; - - - - - -private: - tInterrupt(const tInterrupt&); - void operator=(const tInterrupt&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Interrupt_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tInterruptManager.h b/hal/Azalea/src/main/native/ChipObject/tInterruptManager.h deleted file mode 100644 index d7e96a257f..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tInterruptManager.h +++ /dev/null @@ -1,50 +0,0 @@ -// Class for handling interrupts. -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tInterruptManager_h__ -#define __tInterruptManager_h__ - -#include "NiRio.h" -#include "tSystem.h" -#include - -namespace nFPGA -{ - -typedef void (*tInterruptHandler)(uint32_t interruptAssertedMask, void *param); - -class tInterruptManager : public tSystem -{ -public: - tInterruptManager(uint32_t interruptMask, bool watcher, tRioStatusCode *status); - ~tInterruptManager(); - void registerHandler(tInterruptHandler handler, void *param, tRioStatusCode *status); - uint32_t watch(int32_t timeoutInMs, tRioStatusCode *status); - void enable(tRioStatusCode *status); - void disable(tRioStatusCode *status); - bool isEnabled(tRioStatusCode *status); -private: - void handler(); - static int handlerWrapper(tInterruptManager *pInterrupt); - - void acknowledge(tRioStatusCode *status); - void reserve(tRioStatusCode *status); - void unreserve(tRioStatusCode *status); - tInterruptHandler _handler; - uint32_t _interruptMask; - int32_t _taskId; - NiFpga_IrqContext _rioContext; - bool _watcher; - bool _enabled; - void *_userParam; - - // maintain the interrupts that are already dealt with. - static uint32_t _globalInterruptMask; - static SEM_ID _globalInterruptMaskSemaphore; -}; - -} - - -#endif // __tInterruptManager_h__ - diff --git a/hal/Azalea/src/main/native/ChipObject/tSPI.h b/hal/Azalea/src/main/native/ChipObject/tSPI.h deleted file mode 100644 index f113604121..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tSPI.h +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_SPI_h__ -#define __nFRC_2012_1_6_4_SPI_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tSPI -{ -public: - tSPI(){} - virtual ~tSPI(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tSPI* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned ReceivedDataOverflow : 1; - unsigned Idle : 1; - }; - struct{ - unsigned value : 2; - }; - } tStatus; - typedef - union{ - struct{ - unsigned BusBitWidth : 8; - unsigned ClockHalfPeriodDelay : 8; - unsigned MSBfirst : 1; - unsigned DataOnFalling : 1; - unsigned LatchFirst : 1; - unsigned LatchLast : 1; - unsigned FramePolarity : 1; - unsigned WriteOnly : 1; - unsigned ClockPolarity : 1; - }; - struct{ - unsigned value : 23; - }; - } tConfig; - typedef - union{ - struct{ - unsigned SCLK_Channel : 4; - unsigned SCLK_Module : 1; - unsigned MOSI_Channel : 4; - unsigned MOSI_Module : 1; - unsigned MISO_Channel : 4; - unsigned MISO_Module : 1; - unsigned SS_Channel : 4; - unsigned SS_Module : 1; - }; - struct{ - unsigned value : 20; - }; - } tChannels; - - - - typedef enum - { - } tStatus_IfaceConstants; - - virtual tStatus readStatus(tRioStatusCode *status) = 0; - virtual bool readStatus_ReceivedDataOverflow(tRioStatusCode *status) = 0; - virtual bool readStatus_Idle(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReadReceivedData_IfaceConstants; - - virtual void strobeReadReceivedData(tRioStatusCode *status) = 0; - - - typedef enum - { - } tConfig_IfaceConstants; - - virtual void writeConfig(tConfig value, tRioStatusCode *status) = 0; - virtual void writeConfig_BusBitWidth(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_ClockHalfPeriodDelay(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeConfig_MSBfirst(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_DataOnFalling(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_LatchFirst(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_LatchLast(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_FramePolarity(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_WriteOnly(bool value, tRioStatusCode *status) = 0; - virtual void writeConfig_ClockPolarity(bool value, tRioStatusCode *status) = 0; - virtual tConfig readConfig(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_BusBitWidth(tRioStatusCode *status) = 0; - virtual unsigned char readConfig_ClockHalfPeriodDelay(tRioStatusCode *status) = 0; - virtual bool readConfig_MSBfirst(tRioStatusCode *status) = 0; - virtual bool readConfig_DataOnFalling(tRioStatusCode *status) = 0; - virtual bool readConfig_LatchFirst(tRioStatusCode *status) = 0; - virtual bool readConfig_LatchLast(tRioStatusCode *status) = 0; - virtual bool readConfig_FramePolarity(tRioStatusCode *status) = 0; - virtual bool readConfig_WriteOnly(tRioStatusCode *status) = 0; - virtual bool readConfig_ClockPolarity(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReceivedData_IfaceConstants; - - virtual unsigned int readReceivedData(tRioStatusCode *status) = 0; - - - typedef enum - { - } tDataToLoad_IfaceConstants; - - virtual void writeDataToLoad(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readDataToLoad(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReset_IfaceConstants; - - virtual void strobeReset(tRioStatusCode *status) = 0; - - - typedef enum - { - } tChannels_IfaceConstants; - - virtual void writeChannels(tChannels value, tRioStatusCode *status) = 0; - virtual void writeChannels_SCLK_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_SCLK_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MOSI_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MOSI_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MISO_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_MISO_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_SS_Channel(unsigned char value, tRioStatusCode *status) = 0; - virtual void writeChannels_SS_Module(unsigned char value, tRioStatusCode *status) = 0; - virtual tChannels readChannels(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SCLK_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SCLK_Module(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MOSI_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MOSI_Module(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MISO_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_MISO_Module(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SS_Channel(tRioStatusCode *status) = 0; - virtual unsigned char readChannels_SS_Module(tRioStatusCode *status) = 0; - - - typedef enum - { - } tClearReceivedData_IfaceConstants; - - virtual void strobeClearReceivedData(tRioStatusCode *status) = 0; - - - typedef enum - { - } tReceivedElements_IfaceConstants; - - virtual unsigned short readReceivedElements(tRioStatusCode *status) = 0; - - - typedef enum - { - } tLoad_IfaceConstants; - - virtual void strobeLoad(tRioStatusCode *status) = 0; - - - typedef enum - { - } tAvailableToLoad_IfaceConstants; - - virtual unsigned short readAvailableToLoad(tRioStatusCode *status) = 0; - - - - -private: - tSPI(const tSPI&); - void operator=(const tSPI&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_SPI_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tSolenoid.h b/hal/Azalea/src/main/native/ChipObject/tSolenoid.h deleted file mode 100644 index 67c9a40103..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tSolenoid.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Solenoid_h__ -#define __nFRC_2012_1_6_4_Solenoid_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tSolenoid -{ -public: - tSolenoid(){} - virtual ~tSolenoid(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tSolenoid* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - kNumDO7_0Elements = 2, - } tDO7_0_IfaceConstants; - - virtual void writeDO7_0(unsigned char bitfield_index, unsigned char value, tRioStatusCode *status) = 0; - virtual unsigned char readDO7_0(unsigned char bitfield_index, tRioStatusCode *status) = 0; - - - - -private: - tSolenoid(const tSolenoid&); - void operator=(const tSolenoid&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Solenoid_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tSysWatchdog.h b/hal/Azalea/src/main/native/ChipObject/tSysWatchdog.h deleted file mode 100644 index daca9b6d0f..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tSysWatchdog.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_SysWatchdog_h__ -#define __nFRC_2012_1_6_4_SysWatchdog_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tSysWatchdog -{ -public: - tSysWatchdog(){} - virtual ~tSysWatchdog(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tSysWatchdog* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - - - - typedef enum - { - } tCommand_IfaceConstants; - - virtual void writeCommand(unsigned short value, tRioStatusCode *status) = 0; - virtual unsigned short readCommand(tRioStatusCode *status) = 0; - - - typedef enum - { - } tChallenge_IfaceConstants; - - virtual unsigned char readChallenge(tRioStatusCode *status) = 0; - - - typedef enum - { - } tActive_IfaceConstants; - - virtual void writeActive(bool value, tRioStatusCode *status) = 0; - virtual bool readActive(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimer_IfaceConstants; - - virtual unsigned int readTimer(tRioStatusCode *status) = 0; - - - - -private: - tSysWatchdog(const tSysWatchdog&); - void operator=(const tSysWatchdog&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_SysWatchdog_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tSystem.h b/hal/Azalea/src/main/native/ChipObject/tSystem.h deleted file mode 100644 index b5dccf03a4..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tSystem.h +++ /dev/null @@ -1,47 +0,0 @@ -// Base class for generated chip objects -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tSystem_h__ -#define __tSystem_h__ - -#include "NiRio.h" -#include - -#define FRC_FPGA_PRELOAD_BITFILE - -typedef uint32_t NiFpga_Session; - -namespace nFPGA -{ - -class tSystem -{ -public: - tSystem(tRioStatusCode *status); - ~tSystem(); - void getFpgaGuid(uint32_t *guid_ptr, tRioStatusCode *status); - -protected: - static NiFpga_Session _DeviceHandle; - -#ifdef FRC_FPGA_PRELOAD_BITFILE - void NiFpga_SharedOpen_common(const char* bitfile); - NiFpga_Status NiFpga_SharedOpen(const char* bitfile, - const char* signature, - const char* resource, - uint32_t attribute, - NiFpga_Session* session); - NiFpga_Status NiFpgaLv_SharedOpen(const char* const bitfile, - const char* const apiSignature, - const char* const resource, - const uint32_t attribute, - NiFpga_Session* const session); -private: - static char *_FileName; - static char *_Bitfile; -#endif -}; - -} - -#endif // __tSystem_h__ diff --git a/hal/Azalea/src/main/native/ChipObject/tSystemInterface.h b/hal/Azalea/src/main/native/ChipObject/tSystemInterface.h deleted file mode 100644 index 46786e8e7d..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tSystemInterface.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. - -#ifndef __tSystemInterface_h__ -#define __tSystemInterface_h__ - -namespace nFPGA -{ - -class tSystemInterface -{ -public: - tSystemInterface(){} - virtual ~tSystemInterface(){} - - virtual const uint16_t getExpectedFPGAVersion()=0; - virtual const uint32_t getExpectedFPGARevision()=0; - virtual const uint32_t * const getExpectedFPGASignature()=0; - virtual void getHardwareFpgaSignature(uint32_t *guid_ptr, tRioStatusCode *status)=0; - virtual uint32_t getLVHandle(tRioStatusCode *status)=0; - virtual uint32_t getHandle()=0; -}; - -} - -#endif // __tSystemInterface_h__ - diff --git a/hal/Azalea/src/main/native/ChipObject/tWatchdog.h b/hal/Azalea/src/main/native/ChipObject/tWatchdog.h deleted file mode 100644 index f5ef16a8dd..0000000000 --- a/hal/Azalea/src/main/native/ChipObject/tWatchdog.h +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) National Instruments 2008. All Rights Reserved. -// Do Not Edit... this file is generated! - -#ifndef __nFRC_2012_1_6_4_Watchdog_h__ -#define __nFRC_2012_1_6_4_Watchdog_h__ - -#include "tSystemInterface.h" - -namespace nFPGA -{ -namespace nFRC_2012_1_6_4 -{ - -class tWatchdog -{ -public: - tWatchdog(){} - virtual ~tWatchdog(){} - - virtual tSystemInterface* getSystemInterface() = 0; - static tWatchdog* create(tRioStatusCode *status); - - typedef enum - { - kNumSystems = 1, - } tIfaceConstants; - - typedef - union{ - struct{ - unsigned SystemActive : 1; - unsigned Alive : 1; - unsigned SysDisableCount : 15; - unsigned DisableCount : 15; - }; - struct{ - unsigned value : 32; - }; - } tStatus; - - - - typedef enum - { - } tStatus_IfaceConstants; - - virtual tStatus readStatus(tRioStatusCode *status) = 0; - virtual bool readStatus_SystemActive(tRioStatusCode *status) = 0; - virtual bool readStatus_Alive(tRioStatusCode *status) = 0; - virtual unsigned short readStatus_SysDisableCount(tRioStatusCode *status) = 0; - virtual unsigned short readStatus_DisableCount(tRioStatusCode *status) = 0; - - - typedef enum - { - } tImmortal_IfaceConstants; - - virtual void writeImmortal(bool value, tRioStatusCode *status) = 0; - virtual bool readImmortal(tRioStatusCode *status) = 0; - - - typedef enum - { - } tKill_IfaceConstants; - - virtual void strobeKill(tRioStatusCode *status) = 0; - - - typedef enum - { - } tFeed_IfaceConstants; - - virtual void strobeFeed(tRioStatusCode *status) = 0; - - - typedef enum - { - } tExpiration_IfaceConstants; - - virtual void writeExpiration(unsigned int value, tRioStatusCode *status) = 0; - virtual unsigned int readExpiration(tRioStatusCode *status) = 0; - - - typedef enum - { - } tTimer_IfaceConstants; - - virtual unsigned int readTimer(tRioStatusCode *status) = 0; - - - - -private: - tWatchdog(const tWatchdog&); - void operator=(const tWatchdog&); -}; - -} -} - -#endif // __nFRC_2012_1_6_4_Watchdog_h__ diff --git a/hal/Azalea/src/main/native/Digital.cpp b/hal/Azalea/src/main/native/Digital.cpp deleted file mode 100644 index 9dec4e48f9..0000000000 --- a/hal/Azalea/src/main/native/Digital.cpp +++ /dev/null @@ -1,1492 +0,0 @@ - -#include "HAL/Digital.h" - -#include "Port.h" -#include "HAL/HAL.h" -#include "ChipObject.h" -#include "HAL/cpp/Synchronized.h" -#include "HAL/cpp/Resource.h" -#include "NetworkCommunication/LoadOut.h" -#include -#include - -static const uint32_t kExpectedLoopTiming = 260; -static const uint32_t kDigitalPins = 14; -static const uint32_t kDigitalModules = 2; -static const uint32_t kPwmPins = 10; -static const uint32_t kRelayPins = 8; -/** - * kDefaultPwmPeriod is in ms - * - * - 20ms periods (50 Hz) are the "safest" setting in that this works for all devices - * - 20ms periods seem to be desirable for Vex Motors - * - 20ms periods are the specified period for HS-322HD servos, but work reliably down - * to 10.0 ms; starting at about 8.5ms, the servo sometimes hums and get hot; - * by 5.0ms the hum is nearly continuous - * - 10ms periods work well for Victor 884 - * - 5ms periods allows higher update rates for Luminary Micro Jaguar speed controllers. - * Due to the shipping firmware on the Jaguar, we can't run the update period less - * than 5.05 ms. - * - * kDefaultPwmPeriod is the 1x period (5.05 ms). In hardware, the period scaling is implemented as an - * output squelch to get longer periods for old devices. - */ -static const float kDefaultPwmPeriod = 5.05; -/** - * kDefaultPwmCenter is the PWM range center in ms - */ -static const float kDefaultPwmCenter = 1.5; -/** - * kDefaultPWMStepsDown is the number of PWM steps below the centerpoint - */ -static const int32_t kDefaultPwmStepsDown = 128; -static const int32_t kPwmDisabled = 0; - -struct digital_port_t { - Port port; - tDIO *module; - uint32_t PWMGeneratorID; -}; -typedef struct digital_port_t DigitalPort; - -static MUTEX_ID digitalDIOSemaphore = NULL; -static MUTEX_ID digitalRelaySemaphore = NULL; -static MUTEX_ID digitalPwmSemaphore = NULL; -static MUTEX_ID digitalI2CSemaphore = NULL; -static tDIO* digitalModules[2] = {NULL, NULL}; -static Resource *DIOChannels = NULL; -static Resource *DO_PWMGenerators[tDIO::kNumSystems] = {NULL}; - -bool digitalModulesInitialized = false; - -/** - * Initialize the digital modules. - */ -void initializeDigital(int32_t *status) { - if (digitalModulesInitialized) return; - - // Create a semaphore to protect changes to the digital output values - digitalDIOSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - // Create a semaphore to protect changes to the relay values - digitalRelaySemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - // Create a semaphore to protect changes to the DO PWM config - digitalPwmSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - digitalI2CSemaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - for (unsigned int i = 0; i < (sizeof(digitalModules)/sizeof(digitalModules[0])); i++) { - Resource::CreateResourceObject(&DIOChannels, tDIO::kNumSystems * kDigitalPins); - Resource::CreateResourceObject(&DO_PWMGenerators[i], tDIO::kNumDO_PWMDutyCycleElements); - digitalModules[i] = tDIO::create(i, status); - - // Make sure that the 9403 IONode has had a chance to initialize before continuing. - while(digitalModules[i]->readLoopTiming(status) == 0) delayTicks(1); - - if (digitalModules[i]->readLoopTiming(status) != kExpectedLoopTiming) { - // TODO: char err[128]; - // TODO: sprintf(err, "DIO LoopTiming: %d, expecting: %lu\n", digitalModules[port->module-1]->readLoopTiming(status), kExpectedLoopTiming); - *status = LOOP_TIMING_ERROR; // NOTE: Doesn't display the error - } - - //Calculate the length, in ms, of one DIO loop - double loopTime = digitalModules[i]->readLoopTiming(status)/(kSystemClockTicksPerMicrosecond*1e3); - - digitalModules[i]->writePWMConfig_Period((uint16_t) (kDefaultPwmPeriod/loopTime + .5), status); - digitalModules[i]->writePWMConfig_MinHigh((uint16_t) ((kDefaultPwmCenter-kDefaultPwmStepsDown*loopTime)/loopTime + .5), status); - - // Ensure that PWM output values are set to OFF - for (uint32_t pwm_index = 1; pwm_index <= kPwmPins; pwm_index++) { - // Initialize port structure - DigitalPort* digital_port = new DigitalPort(); - digital_port->port.pin = pwm_index; - digital_port->port.module = i + 1; - digital_port->module = digitalModules[i]; - - setPWM(digital_port, kPwmDisabled, status); - setPWMPeriodScale(digital_port, 3, status); // Set all to 4x by default. - } - - // Turn off all relay outputs. - digitalModules[i]->writeSlowValue_RelayFwd(0, status); - digitalModules[i]->writeSlowValue_RelayRev(0, status); - } - digitalModulesInitialized = true; -} - -/** - * Create a new instance of an digital module. - * Create an instance of the digital module object. Initialize all the parameters - * to reasonable values on start. - * Setting a global value on an digital module can be done only once unless subsequent - * values are set the previously set value. - * Digital modules are a singleton, so the constructor is never called outside of this class. - * - * @param moduleNumber The digital module to create (1 or 2). - */ -void* initializeDigitalPort(void* port_pointer, int32_t *status) { - initializeDigital(status); - Port* port = (Port*) port_pointer; - - // Initialize port structure - DigitalPort* digital_port = new DigitalPort(); - digital_port->port = *port; - digital_port->module = digitalModules[digital_port->port.module-1]; - - return digital_port; -} - -bool checkDigitalModule(uint8_t module) { - if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Digital, module - 1)) - return true; - return false; -} - -bool checkPWMChannel(void* digital_port_pointer) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - if (port->port.pin > 0 && port->port.pin <= kPwmPins) - return true; - return false; -} - -bool checkRelayChannel(void* digital_port_pointer) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - if (port->port.pin > 0 && port->port.pin <= kRelayPins) - return true; - return false; -} - -uint8_t remapDigitalChannel(uint32_t pin, int32_t *status) { - return 15 - pin; // TODO: Need channel validation -} - -uint8_t unmapDigitalChannel(uint32_t pin, int32_t *status) { - return 15 - pin; // TODO: Need channel validation -} - -/** - * Set a PWM channel to the desired value. The values range from 0 to 255 and the period is controlled - * by the PWM Period and MinHigh registers. - * - * @param channel The PWM channel to set. - * @param value The PWM value to set. - */ -void setPWM(void* digital_port_pointer, unsigned short value, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkPWMChannel(port); - port->module->writePWMValue(port->port.pin - 1, value, status); -} - -/** - * Get a value from a PWM channel. The values range from 0 to 255. - * - * @param channel The PWM channel to read from. - * @return The raw PWM value. - */ -unsigned short getPWM(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkPWMChannel(port); - return port->module->readPWMValue(port->port.pin - 1, status); -} - -/** - * Set how how often the PWM signal is squelched, thus scaling the period. - * - * @param channel The PWM channel to configure. - * @param squelchMask The 2-bit mask of outputs to squelch. - */ -void setPWMPeriodScale(void* digital_port_pointer, uint32_t squelchMask, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkPWMChannel(port); - port->module->writePWMPeriodScale(port->port.pin - 1, squelchMask, status); -} - -/** - * Allocate a DO PWM Generator. - * Allocate PWM generators so that they are not accidently reused. - * - * @return PWM Generator refnum - */ -void* allocatePWM(int32_t *status) { - return allocatePWMWithModule(0, status); -} - -/** - * Allocate a DO PWM Generator. - * Allocate PWM generators so that they are not accidently reused. - * - * @return PWM Generator refnum - */ -void* allocatePWMWithModule(uint8_t module, int32_t *status) { - char buf[64]; - snprintf(buf, 64, "DO_PWM (Module: %d)", module); - uint32_t* val = NULL; - *val = DO_PWMGenerators[(module - 1)]->Allocate(buf); - return val; -} - -/** - * Free the resource associated with a DO PWM generator. - * - * @param pwmGenerator The pwmGen to free that was allocated with AllocateDO_PWM() - */ -void freePWM(void* pwmGenerator, int32_t *status) { - freePWMWithModule(0, pwmGenerator, status); -} - -/** - * Free the resource associated with a DO PWM generator. - * - * @param pwmGenerator The pwmGen to free that was allocated with AllocateDO_PWM() - */ -void freePWMWithModule(uint8_t module, void* pwmGenerator, int32_t *status) { - uint32_t id = *((uint32_t*) pwmGenerator); - if (id == ~0ul) return; - DO_PWMGenerators[(module - 1)]->Free(id); -} - -/** - * Change the frequency of the DO PWM generator. - * - * The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is logarithmic. - * - * @param rate The frequency to output all digital output PWM signals on this module. - */ -void setPWMRate(double rate, int32_t *status) { - setPWMRateWithModule(0, rate, status); -} - -/** - * Change the frequency of the DO PWM generator. - * - * The valid range is from 0.6 Hz to 19 kHz. The frequency resolution is logarithmic. - * - * @param rate The frequency to output all digital output PWM signals on this module. - */ -void setPWMRateWithModule(uint8_t module, double rate, int32_t *status) { - // Currently rounding in the log rate domain... heavy weight toward picking a higher freq. - // TODO: Round in the linear rate domain. - uint8_t pwmPeriodPower = (uint8_t)(log(1.0 / (digitalModules[module-1]->readLoopTiming(status) * 0.25E-6 * rate))/log(2.0) + 0.5); - digitalModules[module-1]->writeDO_PWMConfig_PeriodPower(pwmPeriodPower, status); -} - -/** - * Configure the duty-cycle of the PWM generator - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param dutyCycle The percent duty cycle to output [0..1]. - */ -void setPWMDutyCycle(void* pwmGenerator, double dutyCycle, int32_t *status) { - setPWMDutyCycleWithModule(0, pwmGenerator, dutyCycle, status); -} - -/** - * Configure the duty-cycle of the PWM generator - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param dutyCycle The percent duty cycle to output [0..1]. - */ -void setPWMDutyCycleWithModule(uint8_t module, void* pwmGenerator, double dutyCycle, int32_t *status) { - uint32_t id = *((uint32_t*) pwmGenerator); - if (id == ~0ul) return; - if (dutyCycle > 1.0) dutyCycle = 1.0; - if (dutyCycle < 0.0) dutyCycle = 0.0; - float rawDutyCycle = 256.0 * dutyCycle; - if (rawDutyCycle > 255.5) rawDutyCycle = 255.5; - { - Synchronized sync(digitalPwmSemaphore); - uint8_t pwmPeriodPower = digitalModules[module-1]->readDO_PWMConfig_PeriodPower(status); - if (pwmPeriodPower < 4) - { - // The resolution of the duty cycle drops close to the highest frequencies. - rawDutyCycle = rawDutyCycle / pow(2.0, 4 - pwmPeriodPower); - } - digitalModules[module-1]->writeDO_PWMDutyCycle(id, (uint8_t)rawDutyCycle, status); - } -} - -/** - * Configure which DO channel the PWM siganl is output on - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param channel The Digital Output channel to output on - */ -void setPWMOutputChannel(void* pwmGenerator, uint32_t pin, int32_t *status) { - setPWMOutputChannelWithModule(0, pwmGenerator, pin, status); -} - -/** - * Configure which DO channel the PWM siganl is output on - * - * @param pwmGenerator The generator index reserved by AllocateDO_PWM() - * @param channel The Digital Output channel to output on - */ -void setPWMOutputChannelWithModule(uint8_t module, void* pwmGenerator, uint32_t pin, int32_t *status) { - uint32_t id = *((uint32_t*) pwmGenerator); - if (id == ~0ul) return; - switch(id) { - case 0: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_0(remapDigitalChannel(pin - 1, status), status); - break; - case 1: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_1(remapDigitalChannel(pin - 1, status), status); - break; - case 2: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_2(remapDigitalChannel(pin - 1, status), status); - break; - case 3: - digitalModules[module-1]->writeDO_PWMConfig_OutputSelect_3(remapDigitalChannel(pin - 1, status), status); - break; - } -} - -/** - * Set the state of a relay. - * Set the state of a relay output to be forward. Relays have two outputs and each is - * independently set to 0v or 12v. - */ -void setRelayForward(void* digital_port_pointer, bool on, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkRelayChannel(port); - { - Synchronized sync(digitalRelaySemaphore); - uint8_t forwardRelays = port->module->readSlowValue_RelayFwd(status); - if (on) - forwardRelays |= 1 << (port->port.pin - 1); - else - forwardRelays &= ~(1 << (port->port.pin - 1)); - port->module->writeSlowValue_RelayFwd(forwardRelays, status); - } -} - -/** - * Set the state of a relay. - * Set the state of a relay output to be reverse. Relays have two outputs and each is - * independently set to 0v or 12v. - */ -void setRelayReverse(void* digital_port_pointer, bool on, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - checkRelayChannel(port); - { - Synchronized sync(digitalRelaySemaphore); - uint8_t reverseRelays = port->module->readSlowValue_RelayRev(status); - if (on) - reverseRelays |= 1 << (port->port.pin - 1); - else - reverseRelays &= ~(1 << (port->port.pin - 1)); - port->module->writeSlowValue_RelayRev(reverseRelays, status); - } -} - -/** - * Get the current state of the forward relay channel - */ -bool getRelayForward(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint8_t forwardRelays = port->module->readSlowValue_RelayFwd(status); - return (forwardRelays & (1 << (port->port.pin - 1))) != 0; -} - -/** - * Get the current state of the reverse relay channel - */ -bool getRelayReverse(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint8_t reverseRelays = port->module->readSlowValue_RelayRev(status); - return (reverseRelays & (1 << (port->port.pin - 1))) != 0; -} - -/** - * Allocate Digital I/O channels. - * Allocate channels so that they are not accidently reused. Also the direction is set at the - * time of the allocation. - * - * @param channel The Digital I/O channel - * @param input If true open as input; if false open as output - * @return Was successfully allocated - */ -bool allocateDIO(void* digital_port_pointer, bool input, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - char buf[64]; - snprintf(buf, 64, "DIO %d (Module %d)", port->port.pin, port->port.module); - if (DIOChannels->Allocate(kDigitalPins * (port->port.module - 1) + port->port.pin - 1, buf) == ~0ul) return false; - { - Synchronized sync(digitalDIOSemaphore); - uint32_t bitToSet = 1 << (remapDigitalChannel(port->port.pin - 1, status)); - uint32_t outputEnable = port->module->readOutputEnable(status); - uint32_t outputEnableValue; - if (input) { - outputEnableValue = outputEnable & (~bitToSet); // clear the bit for read - } else { - outputEnableValue = outputEnable | bitToSet; // set the bit for write - } - port->module->writeOutputEnable(outputEnableValue, status); - } - return true; -} - -/** - * Free the resource associated with a digital I/O channel. - * - * @param channel The Digital I/O channel to free - */ -void freeDIO(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - DIOChannels->Free(kDigitalPins * (port->port.module - 1) + port->port.pin - 1); -} - -/** - * Write a digital I/O bit to the FPGA. - * Set a single value on a digital I/O channel. - * - * @param channel The Digital I/O channel - * @param value The state to set the digital channel (if it is configured as an output) - */ -void setDIO(void* digital_port_pointer, short value, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - if (value != 0 && value != 1) { - if (value != 0) - value = 1; - } - { - Synchronized sync(digitalDIOSemaphore); - uint16_t currentDIO = port->module->readDO(status); - if(value == 0) { - currentDIO = currentDIO & ~(1 << remapDigitalChannel(port->port.pin - 1, status)); - } else if (value == 1) { - currentDIO = currentDIO | (1 << remapDigitalChannel(port->port.pin - 1, status)); - } - port->module->writeDO(currentDIO, status); - } -} - -/** - * Read a digital I/O bit from the FPGA. - * Get a single value from a digital I/O channel. - * - * @param channel The digital I/O channel - * @return The state of the specified channel - */ -bool getDIO(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint32_t currentDIO = port->module->readDI(status); - - //Shift 00000001 over channel-1 places. - //AND it against the currentDIO - //if it == 0, then return false - //else return true - return ((currentDIO >> remapDigitalChannel(port->port.pin - 1, status)) & 1) != 0; -} - -/** - * Read the direction of a the Digital I/O lines - * A 1 bit means output and a 0 bit means input. - * - * @param channel The digital I/O channel - * @return The direction of the specified channel - */ -bool getDIODirection(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint32_t currentOutputEnable = port->module->readOutputEnable(status); - - //Shift 00000001 over port->port.pin-1 places. - //AND it against the currentOutputEnable - //if it == 0, then return false - //else return true - return ((currentOutputEnable >> remapDigitalChannel(port->port.pin - 1, status)) & 1) != 0; -} - -/** - * Generate a single pulse. - * Write a pulse to the specified digital output channel. There can only be a single pulse going at any time. - * - * @param channel The Digital Output channel that the pulse should be output on - * @param pulseLength The active length of the pulse (in seconds) - */ -void pulse(void* digital_port_pointer, double pulseLength, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint16_t mask = 1 << remapDigitalChannel(port->port.pin - 1, status); - port->module->writePulseLength((uint8_t)(1.0e9 * pulseLength / (port->module->readLoopTiming(status) * 25)), status); - port->module->writePulse(mask, status); -} - -/** - * Check a DIO line to see if it is currently generating a pulse. - * - * @return A pulse is in progress - */ -bool isPulsing(void* digital_port_pointer, int32_t *status) { - DigitalPort* port = (DigitalPort*) digital_port_pointer; - uint16_t mask = 1 << remapDigitalChannel(port->port.pin - 1, status); - uint16_t pulseRegister = port->module->readPulse(status); - return (pulseRegister & mask) != 0; -} - -/** - * Check if any DIO line is currently generating a pulse. - * - * @return A pulse on some line is in progress - */ -bool isAnyPulsing(int32_t *status) { - return isAnyPulsingWithModule(1, status) || isAnyPulsingWithModule(2, status); -} - -/** - * Check if any DIO line is currently generating a pulse. - * - * @return A pulse on some line is in progress - */ -bool isAnyPulsingWithModule(uint8_t module, int32_t *status) { - uint16_t pulseRegister = digitalModules[module-1]->readPulse(status); - return pulseRegister != 0; -} - - - -struct counter_t { - tCounter* counter; - uint32_t index; -}; -typedef struct counter_t Counter; - -static Resource *counters = NULL; - -void* initializeCounter(Mode mode, uint32_t *index, int32_t *status) { - Resource::CreateResourceObject(&counters, tCounter::kNumSystems); - *index = counters->Allocate("Counter"); - if (*index == ~0ul) { - *status = NO_AVAILABLE_RESOURCES; - return NULL; - } - Counter* counter = new Counter(); - counter->counter = tCounter::create(*index, status); - counter->counter->writeConfig_Mode(mode, status); - counter->counter->writeTimerConfig_AverageSize(1, status); - counter->index = *index; - return counter; -} - -void freeCounter(void* counter_pointer, int32_t *status) { - if (counter_pointer != NULL) { - Counter* counter = (Counter*) counter_pointer; - delete counter->counter; - counters->Free(counter->index); - } else { - *status = NULL_PARAMETER; - } -} - -void setCounterAverageSize(void* counter_pointer, int32_t size, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeTimerConfig_AverageSize(size, status); -} - -/** - * Set the source object that causes the counter to count up. - * Set the up counting DigitalSource. - */ -void setCounterUpSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin, - bool analogTrigger, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - - counter->counter->writeConfig_UpSource_Module(module, status); - counter->counter->writeConfig_UpSource_Channel(pin, status); - counter->counter->writeConfig_UpSource_AnalogTrigger(analogTrigger, status); - - if(counter->counter->readConfig_Mode(status) == kTwoPulse || - counter->counter->readConfig_Mode(status) == kExternalDirection) { - setCounterUpSourceEdge(counter_pointer, true, false, status); - } - counter->counter->strobeReset(status); -} - -/** - * Set the edge sensitivity on an up counting source. - * Set the up source to either detect rising edges or falling edges. - */ -void setCounterUpSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_UpRisingEdge(risingEdge, status); - counter->counter->writeConfig_UpFallingEdge(fallingEdge, status); -} - -/** - * Disable the up counting source to the counter. - */ -void clearCounterUpSource(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - bool state = counter->counter->readConfig_Enable(status); - counter->counter->writeConfig_Enable(false, status); - counter->counter->writeConfig_UpFallingEdge(false, status); - counter->counter->writeConfig_UpRisingEdge(false, status); - // Index 0 of digital is always 0. - counter->counter->writeConfig_UpSource_Channel(0, status); - counter->counter->writeConfig_UpSource_AnalogTrigger(false, status); - counter->counter->writeConfig_Enable(state, status); -} - -/** - * Set the source object that causes the counter to count down. - * Set the down counting DigitalSource. - */ -void setCounterDownSourceWithModule(void* counter_pointer, uint8_t module, uint32_t pin, - bool analogTrigger, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - unsigned char mode = counter->counter->readConfig_Mode(status); - if (mode != kTwoPulse && mode != kExternalDirection) { - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "Counter only supports DownSource in TwoPulse and ExternalDirection modes."); - *status = PARAMETER_OUT_OF_RANGE; - return; - } - counter->counter->writeConfig_DownSource_Module(module, status); - counter->counter->writeConfig_DownSource_Channel(pin, status); - counter->counter->writeConfig_DownSource_AnalogTrigger(analogTrigger, status); - - setCounterDownSourceEdge(counter_pointer, true, false, status); - counter->counter->strobeReset(status); -} - -/** - * Set the edge sensitivity on a down counting source. - * Set the down source to either detect rising edges or falling edges. - */ -void setCounterDownSourceEdge(void* counter_pointer, bool risingEdge, bool fallingEdge, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_DownRisingEdge(risingEdge, status); - counter->counter->writeConfig_DownFallingEdge(fallingEdge, status); -} - -/** - * Disable the down counting source to the counter. - */ -void clearCounterDownSource(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - bool state = counter->counter->readConfig_Enable(status); - counter->counter->writeConfig_Enable(false, status); - counter->counter->writeConfig_DownFallingEdge(false, status); - counter->counter->writeConfig_DownRisingEdge(false, status); - // Index 0 of digital is always 0. - counter->counter->writeConfig_DownSource_Channel(0, status); - counter->counter->writeConfig_DownSource_AnalogTrigger(false, status); - counter->counter->writeConfig_Enable(state, status); -} - -/** - * Set standard up / down counting mode on this counter. - * Up and down counts are sourced independently from two inputs. - */ -void setCounterUpDownMode(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kTwoPulse, status); -} - -/** - * Set external direction mode on this counter. - * Counts are sourced on the Up counter input. - * The Down counter input represents the direction to count. - */ -void setCounterExternalDirectionMode(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kExternalDirection, status); -} - -/** - * Set Semi-period mode on this counter. - * Counts up on both rising and falling edges. - */ -void setCounterSemiPeriodMode(void* counter_pointer, bool highSemiPeriod, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kSemiperiod, status); - counter->counter->writeConfig_UpRisingEdge(highSemiPeriod, status); - setCounterUpdateWhenEmpty(counter_pointer, false, status); -} - -/** - * Configure the counter to count in up or down based on the length of the input pulse. - * This mode is most useful for direction sensitive gear tooth sensors. - * @param threshold The pulse length beyond which the counter counts the opposite direction. Units are seconds. - */ -void setCounterPulseLengthMode(void* counter_pointer, double threshold, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Mode(kPulseLength, status); - counter->counter->writeConfig_PulseLengthThreshold((uint32_t)(threshold * 1.0e6) * kSystemClockTicksPerMicrosecond, status); -} - -/** - * Get the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @return SamplesToAverage The number of samples being averaged (from 1 to 127) - */ -int32_t getCounterSamplesToAverage(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - return counter->counter->readTimerConfig_AverageSize(status); -} - -/** - * Set the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @param samplesToAverage The number of samples to average from 1 to 127. - */ -void setCounterSamplesToAverage(void* counter_pointer, int samplesToAverage, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - if (samplesToAverage < 1 || samplesToAverage > 127) { - *status = PARAMETER_OUT_OF_RANGE; - } - counter->counter->writeTimerConfig_AverageSize(samplesToAverage, status); -} - -/** - * Start the Counter counting. - * This enables the counter and it starts accumulating counts from the associated - * input channel. The counter value is not reset on starting, and still has the previous value. - */ -void startCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Enable(1, status); -} - -/** - * Stop the Counter. - * Stops the counting but doesn't effect the current value. - */ -void stopCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeConfig_Enable(0, status); -} - -/** - * Reset the Counter to zero. - * Set the counter value to zero. This doesn't effect the running state of the counter, just sets - * the current value to zero. - */ -void resetCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->strobeReset(status); -} - -/** - * Read the current counter value. - * Read the value at this instant. It may still be running, so it reflects the current value. Next - * time it is read, it might have a different value. - */ -int32_t getCounter(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - int32_t value = counter->counter->readOutput_Value(status); - return value; -} - -/* - * Get the Period of the most recent count. - * Returns the time interval of the most recent count. This can be used for velocity calculations - * to determine shaft speed. - * @returns The period of the last two pulses in units of seconds. - */ -double getCounterPeriod(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - tCounter::tTimerOutput output = counter->counter->readTimerOutput(status); - double period; - if (output.Stalled) { - // Return infinity - double zero = 0.0; - period = 1.0 / zero; - } else { - // output.Period is a fixed point number that counts by 2 (24 bits, 25 integer bits) - period = (double)(output.Period << 1) / (double)output.Count; - } - return period * 1.0e-6; -} - -/** - * Set the maximum period where the device is still considered "moving". - * Sets the maximum period where the device is considered moving. This value is used to determine - * the "stopped" state of the counter using the GetStopped method. - * @param maxPeriod The maximum period where the counted device is considered moving in - * seconds. - */ -void setCounterMaxPeriod(void* counter_pointer, double maxPeriod, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeTimerConfig_StallPeriod((uint32_t)(maxPeriod * 1.0e6), status); -} - -/** - * Select whether you want to continue updating the event timer output when there are no samples captured. - * The output of the event timer has a buffer of periods that are averaged and posted to - * a register on the FPGA. When the timer detects that the event source has stopped - * (based on the MaxPeriod) the buffer of samples to be averaged is emptied. If you - * enable the update when empty, you will be notified of the stopped source and the event - * time will report 0 samples. If you disable update when empty, the most recent average - * will remain on the output until a new sample is acquired. You will never see 0 samples - * output (except when there have been no events since an FPGA reset) and you will likely not - * see the stopped bit become true (since it is updated at the end of an average and there are - * no samples to average). - */ -void setCounterUpdateWhenEmpty(void* counter_pointer, bool enabled, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - counter->counter->writeTimerConfig_UpdateWhenEmpty(enabled, status); -} - -/** - * Determine if the clock is stopped. - * Determine if the clocked input is stopped based on the MaxPeriod value set using the - * SetMaxPeriod method. If the clock exceeds the MaxPeriod, then the device (and counter) are - * assumed to be stopped and it returns true. - * @return Returns true if the most recent counter period exceeds the MaxPeriod value set by - * SetMaxPeriod. - */ -bool getCounterStopped(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - return counter->counter->readTimerOutput_Stalled(status); -} - -/** - * The last direction the counter value changed. - * @return The last direction the counter value changed. - */ -bool getCounterDirection(void* counter_pointer, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - bool value = counter->counter->readOutput_Direction(status); - return value; -} - -/** - * Set the Counter to return reversed sensing on the direction. - * This allows counters to change the direction they are counting in the case of 1X and 2X - * quadrature encoding only. Any other counter mode isn't supported. - * @param reverseDirection true if the value counted should be negated. - */ -void setCounterReverseDirection(void* counter_pointer, bool reverseDirection, int32_t *status) { - Counter* counter = (Counter*) counter_pointer; - if (counter->counter->readConfig_Mode(status) == kExternalDirection) { - if (reverseDirection) - setCounterDownSourceEdge(counter_pointer, true, true, status); - else - setCounterDownSourceEdge(counter_pointer, false, true, status); - } -} - -struct encoder_t { - tEncoder* encoder; - uint32_t index; -}; -typedef struct encoder_t Encoder; - -static const double DECODING_SCALING_FACTOR = 0.25; -static Resource *quadEncoders = NULL; - -void* initializeEncoder(uint8_t port_a_module, uint32_t port_a_pin, bool port_a_analog_trigger, - uint8_t port_b_module, uint32_t port_b_pin, bool port_b_analog_trigger, - bool reverseDirection, int32_t *index, int32_t *status) { - - // Initialize encoder structure - Encoder* encoder = new Encoder(); - - Resource::CreateResourceObject(&quadEncoders, tEncoder::kNumSystems); - encoder->index = quadEncoders->Allocate("4X Encoder"); - *index = encoder->index; - // TODO: if (index == ~0ul) { CloneError(quadEncoders); return; } - encoder->encoder = tEncoder::create(encoder->index, status); - encoder->encoder->writeConfig_ASource_Module(port_a_module, status); - encoder->encoder->writeConfig_ASource_Channel(port_a_pin, status); - encoder->encoder->writeConfig_ASource_AnalogTrigger(port_a_analog_trigger, status); - encoder->encoder->writeConfig_BSource_Module(port_b_module, status); - encoder->encoder->writeConfig_BSource_Channel(port_b_pin, status); - encoder->encoder->writeConfig_BSource_AnalogTrigger(port_b_analog_trigger, status); - encoder->encoder->strobeReset(status); - encoder->encoder->writeConfig_Reverse(reverseDirection, status); - encoder->encoder->writeTimerConfig_AverageSize(4, status); - - return encoder; -} - -void freeEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - quadEncoders->Free(encoder->index); - delete encoder->encoder; -} - -/** - * Start the Encoder. - * Starts counting pulses on the Encoder device. - */ -void startEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeConfig_Enable(1, status); -} - -/** - * Stops counting pulses on the Encoder device. The value is not changed. - */ -void stopEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeConfig_Enable(0, status); -} - -/** - * Reset the Encoder distance to zero. - * Resets the current count to zero on the encoder. - */ -void resetEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->strobeReset(status); -} - -/** - * Gets the raw value from the encoder. - * The raw value is the actual count unscaled by the 1x, 2x, or 4x scale - * factor. - * @return Current raw count from the encoder - */ -int32_t getEncoder(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readOutput_Value(status); -} - -/** - * Returns the period of the most recent pulse. - * Returns the period of the most recent Encoder pulse in seconds. - * This method compenstates for the decoding type. - * - * @deprecated Use GetRate() in favor of this method. This returns unscaled periods and GetRate() scales using value from SetDistancePerPulse(). - * - * @return Period in seconds of the most recent pulse. - */ -double getEncoderPeriod(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - tEncoder::tTimerOutput output = encoder->encoder->readTimerOutput(status); - double value; - if (output.Stalled) { - // Return infinity - double zero = 0.0; - value = 1.0 / zero; - } else { - // output.Period is a fixed point number that counts by 2 (24 bits, 25 integer bits) - value = (double)(output.Period << 1) / (double)output.Count; - } - double measuredPeriod = value * 1.0e-6; - return measuredPeriod / DECODING_SCALING_FACTOR; -} - -/** - * Sets the maximum period for stopped detection. - * Sets the value that represents the maximum period of the Encoder before it will assume - * that the attached device is stopped. This timeout allows users to determine if the wheels or - * other shaft has stopped rotating. - * This method compensates for the decoding type. - * - * @deprecated Use SetMinRate() in favor of this method. This takes unscaled periods and SetMinRate() scales using value from SetDistancePerPulse(). - * - * @param maxPeriod The maximum time between rising and falling edges before the FPGA will - * report the device stopped. This is expressed in seconds. - */ -void setEncoderMaxPeriod(void* encoder_pointer, double maxPeriod, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeTimerConfig_StallPeriod((uint32_t)(maxPeriod * 1.0e6 * DECODING_SCALING_FACTOR), status); -} - -/** - * Determine if the encoder is stopped. - * Using the MaxPeriod value, a boolean is returned that is true if the encoder is considered - * stopped and false if it is still moving. A stopped encoder is one where the most recent pulse - * width exceeds the MaxPeriod. - * @return True if the encoder is considered stopped. - */ -bool getEncoderStopped(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readTimerOutput_Stalled(status) != 0; -} - -/** - * The last direction the encoder value changed. - * @return The last direction the encoder value changed. - */ -bool getEncoderDirection(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readOutput_Direction(status); -} - -/** - * Set the direction sensing for this encoder. - * This sets the direction sensing on the encoder so that it could count in the correct - * software direction regardless of the mounting. - * @param reverseDirection true if the encoder direction should be reversed - */ -void setEncoderReverseDirection(void* encoder_pointer, bool reverseDirection, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - encoder->encoder->writeConfig_Reverse(reverseDirection, status); -} - -/** - * Set the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @param samplesToAverage The number of samples to average from 1 to 127. - */ -void setEncoderSamplesToAverage(void* encoder_pointer, uint32_t samplesToAverage, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - if (samplesToAverage < 1 || samplesToAverage > 127) { - *status = PARAMETER_OUT_OF_RANGE; - } - encoder->encoder->writeTimerConfig_AverageSize(samplesToAverage, status); -} - -/** - * Get the Samples to Average which specifies the number of samples of the timer to - * average when calculating the period. Perform averaging to account for - * mechanical imperfections or as oversampling to increase resolution. - * @return SamplesToAverage The number of samples being averaged (from 1 to 127) - */ -uint32_t getEncoderSamplesToAverage(void* encoder_pointer, int32_t *status) { - Encoder* encoder = (Encoder*) encoder_pointer; - return encoder->encoder->readTimerConfig_AverageSize(status); -} - -/** - * Get the loop timing of the Digital Module - * - * @return The loop time - */ -uint16_t getLoopTiming(int32_t *status) { - return getLoopTimingWithModule(0, status); -} - -/** - * Get the loop timing of the Digital Module - * - * @return The loop time - */ -uint16_t getLoopTimingWithModule(uint8_t module, int32_t *status) { - return digitalModules[module-1]->readLoopTiming(status); -} - - -struct spi_t { - tSPI* spi; - tSPI::tConfig config; - tSPI::tChannels channels; - MUTEX_ID semaphore; -}; -typedef struct spi_t SPI; - -void* initializeSPI(uint8_t sclk_routing_module, uint32_t sclk_routing_pin, - uint8_t mosi_routing_module, uint32_t mosi_routing_pin, - uint8_t miso_routing_module, uint32_t miso_routing_pin, int32_t *status) { - SPI* spi = new SPI(); - - spi->semaphore = initializeMutex(SEMAPHORE_Q_PRIORITY | SEMAPHORE_DELETE_SAFE | SEMAPHORE_INVERSION_SAFE); - - spi->spi = tSPI::create(status); - - spi->config.BusBitWidth = 8; - spi->config.ClockHalfPeriodDelay = 0; - spi->config.MSBfirst = 0; - spi->config.DataOnFalling = 0; - spi->config.LatchFirst = 0; - spi->config.LatchLast = 0; - spi->config.FramePolarity = 0; - spi->config.WriteOnly = miso_routing_pin ? 0 : 1; - spi->config.ClockPolarity = 0; - - spi->channels.SCLK_Channel = sclk_routing_pin; - spi->channels.SCLK_Module = sclk_routing_module; - spi->channels.SS_Channel = 0; - spi->channels.SS_Module = 0; - - if (mosi_routing_pin) { - spi->channels.MOSI_Channel = mosi_routing_pin; - spi->channels.MOSI_Module = mosi_routing_module; - } else { - spi->channels.MOSI_Channel = 0; - spi->channels.MOSI_Module = 0; - } - - if (miso_routing_pin) { - spi->channels.MISO_Channel = miso_routing_pin; - spi->channels.MISO_Module = miso_routing_module; - } else { - spi->channels.MISO_Channel = 0; - spi->channels.MISO_Module = 0; - } - return spi; -} - -void cleanSPI(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - delete spi->spi; - delete spi; -} - -/** - * Configure the number of bits from each word that the slave transmits - * or receives. - * - * @param bits The number of bits in one frame (1 to 32 bits). - */ -void setSPIBitsPerWord(void* spi_pointer, uint32_t bits, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.BusBitWidth = bits; -} - -/** - * Get the number of bits from each word that the slave transmits - * or receives. - * - * @return The number of bits in one frame (1 to 32 bits). - */ -uint32_t getSPIBitsPerWord(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - return spi->config.BusBitWidth; -} - -/** - * Configure the rate of the generated clock signal. - * The default and maximum value is 76,628.4 Hz. - * - * @param hz The clock rate in Hertz. - */ -void setSPIClockRate(void* spi_pointer, double hz, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - int delay = 0; - int loopTiming = getLoopTimingWithModule(spi->spi->readChannels_SCLK_Module(status), status); - double v = (1.0 / hz) / (2 * loopTiming / (kSystemClockTicksPerMicrosecond * 1e6)); - if (v < 1) { - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "SPI Clock too high"); - } - delay = (int) (v + .5); - if (delay > 255) { - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "SPI Clock too low"); - } - - spi->config.ClockHalfPeriodDelay = delay; -} - -/** - * Configure the order that bits are sent and received on the wire - * to be most significant bit first. - */ -void setSPIMSBFirst(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.MSBfirst = 1; -} - -/** - * Configure the order that bits are sent and received on the wire - * to be least significant bit first. - */ -void setSPILSBFirst(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.MSBfirst = 0; -} - -/** - * Configure that the data is stable on the falling edge and the data - * changes on the rising edge. - */ -void setSPISampleDataOnFalling(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.DataOnFalling = 1; -} - -/** - * Configure that the data is stable on the rising edge and the data - * changes on the falling edge. - */ -void setSPISampleDataOnRising(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.DataOnFalling = 0; -} - -void setSPISlaveSelect(void* spi_pointer, uint8_t ss_routing_module, uint32_t ss_routing_pin, - int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->channels.SS_Channel = ss_routing_pin; - spi->channels.SS_Module = ss_routing_module; -} - -void setSPILatchMode(void* spi_pointer, tFrameMode mode, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - switch (mode) { - case kChipSelect: - spi->config.LatchFirst = 0; - spi->config.LatchLast = 0; - break; - case kPreLatchPulse: - spi->config.LatchFirst = 1; - spi->config.LatchLast = 0; - break; - case kPostLatchPulse: - spi->config.LatchFirst = 0; - spi->config.LatchLast = 1; - break; - case kPreAndPostLatchPulse: - spi->config.LatchFirst = 1; - spi->config.LatchLast = 1; - break; - } -} - -tFrameMode getSPILatchMode(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - return (tFrameMode) (spi->config.LatchFirst | (spi->config.LatchLast << 1)); -} - -void setSPIFramePolarity(void* spi_pointer, bool activeLow, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.FramePolarity = activeLow ? 1 : 0; -} - -bool getSPIFramePolarity(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - return spi->config.FramePolarity != 0; -} - -/** - * Configure the clock output line to be active low. - * This is sometimes called clock polarity high. - */ -void setSPIClockActiveLow(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.ClockPolarity = 1; -} - -/** - * Configure the clock output line to be active high. - * This is sometimes called clock polarity low. - */ -void setSPIClockActiveHigh(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->config.ClockPolarity = 0; -} - - -/** - * Apply configuration settings and reset the SPI logic. - */ -void applySPIConfig(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - Synchronized sync(spi->semaphore); - - spi->spi->writeConfig(spi->config, status); - spi->spi->writeChannels(spi->channels, status); - spi->spi->strobeReset(status); -} - -/** - * Get the number of words that can currently be stored before being - * transmitted to the device. - * - * @return The number of words available to be written. - */ -uint16_t getSPIOutputFIFOAvailable(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - uint16_t result = spi->spi->readAvailableToLoad(status); - return result; -} - -/** - * Get the number of words received and currently available to be read from - * the receive FIFO. - * - * @return The number of words available to read. - */ -uint16_t getSPINumReceived(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - uint16_t result = spi->spi->readReceivedElements(status); - return result; -} - -/** - * Have all pending transfers completed? - * - * @return True if no transfers are pending. - */ -bool isSPIDone(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - bool result = spi->spi->readStatus_Idle(status); - return result; -} - - -/** - * Determine if the receive FIFO was full when attempting to add new data at - * end of a transfer. - * - * @return True if the receive FIFO overflowed. - */ -bool hadSPIReceiveOverflow(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - bool result = spi->spi->readStatus_ReceivedDataOverflow(status); - return result; -} - -/** - * Write a word to the slave device. Blocks until there is space in the - * output FIFO. - * - * If not running in output only mode, also saves the data received - * on the MISO input during the transfer into the receive FIFO. - */ -void writeSPI(void* spi_pointer, uint32_t data, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - if (spi->channels.MOSI_Channel == 0 && spi->channels.MOSI_Module == 0) { - *status = SPI_WRITE_NO_MOSI; - return; - } - - Synchronized sync(spi->semaphore); - - while (getSPIOutputFIFOAvailable(spi_pointer, status) == 0) - delayTicks(HAL_NO_WAIT); - - spi->spi->writeDataToLoad(data, status); - spi->spi->strobeLoad(status); -} - -/** - * Read a word from the receive FIFO. - * - * Waits for the current transfer to complete if the receive FIFO is empty. - * - * If the receive FIFO is empty, there is no active transfer, and initiate - * is false, errors. - * - * @param initiate If true, this function pushes "0" into the - * transmit buffer and initiates a transfer. - * If false, this function assumes that data is - * already in the receive FIFO from a previous write. - */ -uint32_t readSPI(void* spi_pointer, bool initiate, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - if (spi->channels.MISO_Channel == 0 && spi->channels.MISO_Module == 0) { - *status = SPI_READ_NO_MISO; - return 0; - } - - uint32_t data; - { - Synchronized sync(spi->semaphore); - - if (initiate) { - spi->spi->writeDataToLoad(0, status); - spi->spi->strobeLoad(status); - } - - // Do we have anything ready to read? - if (getSPINumReceived(spi_pointer, status) == 0) { - if (!initiate && isSPIDone(spi_pointer, status) - && getSPIOutputFIFOAvailable(spi_pointer, status) == kTransmitFIFODepth) { - // Nothing to read: error out - *status = SPI_READ_NO_DATA; - return 0; - } - - // Wait for the transaction to complete - while (getSPINumReceived(spi_pointer, status) == 0) - delayTicks(HAL_NO_WAIT); - } - - spi->spi->strobeReadReceivedData(status); - data = spi->spi->readReceivedData(status); - } - - return data; -} - -/** - * Stop any transfer in progress and empty the transmit FIFO. - */ -void resetSPI(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->spi->strobeReset(status); -} - -/** - * Empty the receive FIFO. - */ -void clearSPIReceivedData(void* spi_pointer, int32_t *status) { - SPI* spi = (SPI*) spi_pointer; - spi->spi->strobeClearReceivedData(status); -} - -/** - * Generic transaction. - * - * This is a lower-level interface to the I2C hardware giving you more control over each transaction. - * - * @param dataToSend Buffer of data to send as part of the transaction. - * @param sendSize Number of bytes to send as part of the transaction. [0..6] - * @param dataReceived Buffer to read data into. - * @param receiveSize Number of byted to read from the device. [0..7] - * @return Transfer Aborted... false for success, true for aborted. - */ -bool doI2CTransaction(uint8_t address, bool compatibilityMode, uint8_t *dataToSend, - uint8_t sendSize, uint8_t *dataReceived, uint8_t receiveSize, - int32_t *status) { - return doI2CTransactionWithModule(1, address, compatibilityMode, dataToSend, sendSize, - dataReceived, receiveSize, status); -} - -/** - * Generic transaction. - * - * This is a lower-level interface to the I2C hardware giving you more control over each transaction. - * - * @param dataToSend Buffer of data to send as part of the transaction. - * @param sendSize Number of bytes to send as part of the transaction. [0..6] - * @param dataReceived Buffer to read data into. - * @param receiveSize Number of byted to read from the device. [0..7] - * @return Transfer Aborted... false for success, true for aborted. - */ -bool doI2CTransactionWithModule(uint8_t module, uint8_t address, bool compatibilityMode, - uint8_t *dataToSend, uint8_t sendSize, uint8_t *dataReceived, - uint8_t receiveSize, int32_t *status) { - initializeDigital(status); - if (sendSize > 6) { - *status = PARAMETER_OUT_OF_RANGE; - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "sendSize"); - return true; - } - if (receiveSize > 7) { - *status = PARAMETER_OUT_OF_RANGE; - // TODO: wpi_setWPIErrorWithContext(ParameterOutOfRange, "receiveSize"); - return true; - } - - uint32_t data=0; - uint32_t dataHigh=0; - uint32_t i; - for(i=0; iwriteI2CConfig_Address(address, status); - digitalModules[module]->writeI2CConfig_BytesToWrite(sendSize, status); - digitalModules[module]->writeI2CConfig_BytesToRead(receiveSize, status); - if (sendSize > 0) digitalModules[module]->writeI2CDataToSend(data, status); - if (sendSize > sizeof(data)) digitalModules[module]->writeI2CConfig_DataToSendHigh(dataHigh, status); - digitalModules[module]->writeI2CConfig_BitwiseHandshake(compatibilityMode, status); - uint8_t transaction = digitalModules[module]->readI2CStatus_Transaction(status); - digitalModules[module]->strobeI2CStart(status); - while(transaction == digitalModules[module]->readI2CStatus_Transaction(status)) delayTicks(1); - while(!digitalModules[module]->readI2CStatus_Done(status)) delayTicks(1); - aborted = digitalModules[module]->readI2CStatus_Aborted(status); - if (receiveSize > 0) data = digitalModules[module]->readI2CDataReceived(status); - if (receiveSize > sizeof(data)) dataHigh = digitalModules[module]->readI2CStatus_DataReceivedHigh(status); - } - - for(i=0; i> (8*i)) & 0xFF; - } - for(; i> (8*(i-sizeof(data)))) & 0xFF; - } - return aborted; -} diff --git a/hal/Azalea/src/main/native/HAL.cpp b/hal/Azalea/src/main/native/HAL.cpp deleted file mode 100644 index 2d4b3489c8..0000000000 --- a/hal/Azalea/src/main/native/HAL.cpp +++ /dev/null @@ -1,106 +0,0 @@ - -#include "HAL/HAL.h" - -#include "Port.h" -#include "HAL/Errors.h" -#include "ChipObject.h" - -const uint32_t solenoid_kNumDO7_0Elements = tSolenoid::kNumDO7_0Elements; -const uint32_t dio_kNumSystems = tDIO::kNumSystems; -const uint32_t interrupt_kNumSystems = tInterrupt::kNumSystems; -const uint32_t kSystemClockTicksPerMicrosecond = 40; - - -void* getPort(uint8_t pin) { - Port* port = new Port(); - port->pin = pin; - port->module = 0; - return port; -} - -/** - * @deprecated Uses module numbers - */ -void* getPortWithModule(uint8_t module, uint8_t pin) { - Port* port = new Port(); - port->pin = pin; - port->module = module; - return port; -} - -const char* getHALErrorMessage(int32_t code) { - if (code == 0) return ""; - else if (code == SAMPLE_RATE_TOO_HIGH) return SAMPLE_RATE_TOO_HIGH_MESSAGE; - else if (code == VOLTAGE_OUT_OF_RANGE) return VOLTAGE_OUT_OF_RANGE_MESSAGE; - else if (code == LOOP_TIMING_ERROR) return LOOP_TIMING_ERROR_MESSAGE; - else if (code == SPI_WRITE_NO_MOSI) return SPI_WRITE_NO_MOSI_MESSAGE; - else if (code == SPI_READ_NO_MISO) return SPI_READ_NO_MISO_MESSAGE; - else if (code == SPI_READ_NO_DATA) return SPI_READ_NO_DATA_MESSAGE; - else if (code == INCOMPATIBLE_STATE) return INCOMPATIBLE_STATE_MESSAGE; - else if (code == NO_AVAILABLE_RESOURCES) return NO_AVAILABLE_RESOURCES_MESSAGE; - else if (code == NULL_PARAMETER) return NULL_PARAMETER_MESSAGE; - else if (code == ANALOG_TRIGGER_LIMIT_ORDER_ERROR) return ANALOG_TRIGGER_LIMIT_ORDER_ERROR_MESSAGE; - else if (code == ANALOG_TRIGGER_PULSE_OUTPUT_ERROR) return ANALOG_TRIGGER_PULSE_OUTPUT_ERROR_MESSAGE; - else if (code == PARAMETER_OUT_OF_RANGE) return PARAMETER_OUT_OF_RANGE_MESSAGE; - else return ""; -} - -/** - * Return the FPGA Version number. - * For now, expect this to be competition year. - * @return FPGA Version number. - */ -uint16_t getFPGAVersion(int32_t *status) { - tGlobal *global = tGlobal::create(status); - uint16_t version = global->readVersion(status); - delete global; - return version; -} - -/** - * Return the FPGA Revision number. - * The format of the revision is 3 numbers. - * The 12 most significant bits are the Major Revision. - * the next 8 bits are the Minor Revision. - * The 12 least significant bits are the Build Number. - * @return FPGA Revision number. - */ -uint32_t getFPGARevision(int32_t *status) { - tGlobal *global = tGlobal::create(status); - uint32_t revision = global->readRevision(status); - delete global; - return revision; -} - -/** - * Read the microsecond-resolution timer on the FPGA. - * - * @return The current time in microseconds according to the FPGA (since FPGA reset). - */ -uint32_t getFPGATime(int32_t *status) { - tGlobal *global = tGlobal::create(status); - uint32_t time = global->readLocalTime(status); - delete global; - return time; -} - - -/** - * Set the state of the FPGA status LED on the cRIO. - */ -void setFPGALED(uint32_t state, int32_t *status) { - tGlobal *global = tGlobal::create(status); - global->writeFPGA_LED(state, status); - delete global; -} - -/** - * Get the current state of the FPGA status LED on the cRIO. - * @return The curent state of the FPGA LED. - */ -int32_t getFPGALED(int32_t *status) { - tGlobal *global = tGlobal::create(status); - bool ledValue = global->readFPGA_LED(status); - delete global; - return ledValue; -} diff --git a/hal/Azalea/src/main/native/Interrupts.cpp b/hal/Azalea/src/main/native/Interrupts.cpp deleted file mode 100644 index c47f5769f4..0000000000 --- a/hal/Azalea/src/main/native/Interrupts.cpp +++ /dev/null @@ -1,86 +0,0 @@ - -#include "HAL/Interrupts.h" - -#include "ChipObject.h" - -struct interrupt_t { - tInterrupt *anInterrupt; - tInterruptManager *manager; -}; -typedef struct interrupt_t Interrupt; - -void* initializeInterrupts(uint32_t interruptIndex, bool watcher, int32_t *status) { - Interrupt* anInterrupt = new Interrupt(); - // Expects the calling leaf class to allocate an interrupt index. - anInterrupt->anInterrupt = tInterrupt::create(interruptIndex, status); - anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status); - anInterrupt->manager = new tInterruptManager(1 << interruptIndex, watcher, status); - return anInterrupt; -} - -void cleanInterrupts(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - delete anInterrupt->anInterrupt; - delete anInterrupt->manager; - anInterrupt->anInterrupt = NULL; - anInterrupt->manager = NULL; -} - -/** - * In synchronous mode, wait for the defined interrupt to occur. - * @param timeout Timeout in seconds - */ -void waitForInterrupt(void* interrupt_pointer, double timeout, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->watch((int32_t)(timeout * 1e3), status); -} - -/** - * Enable interrupts to occur on this input. - * oInterrupts are disabled when the RequestInterrupt call is made. This gives time to do the - * setup of the other options before starting to field interrupts. - */ -void enableInterrupts(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->enable(status); -} - -/** - * Disable Interrupts without without deallocating structures. - */ -void disableInterrupts(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->disable(status); -} - -/** - * Return the timestamp for the interrupt that occurred most recently. - * This is in the same time domain as GetClock(). - * @return Timestamp in seconds since boot. - */ -double readInterruptTimestamp(void* interrupt_pointer, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - uint32_t timestamp = anInterrupt->anInterrupt->readTimeStamp(status); - return timestamp * 1e-6; -} - -void requestInterrupts(void* interrupt_pointer, uint8_t routing_module, uint32_t routing_pin, - bool routing_analog_trigger, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->anInterrupt->writeConfig_WaitForAck(false, status); - anInterrupt->anInterrupt->writeConfig_Source_AnalogTrigger(routing_analog_trigger, status); - anInterrupt->anInterrupt->writeConfig_Source_Channel(routing_pin, status); - anInterrupt->anInterrupt->writeConfig_Source_Module(routing_module, status); -} - -void attachInterruptHandler(void* interrupt_pointer, InterruptHandlerFunction handler, - void* param, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->manager->registerHandler(handler, param, status); -} - -void setInterruptUpSourceEdge(void* interrupt_pointer, bool risingEdge, bool fallingEdge, int32_t *status) { - Interrupt* anInterrupt = (Interrupt*) interrupt_pointer; - anInterrupt->anInterrupt->writeConfig_RisingEdge(risingEdge, status); - anInterrupt->anInterrupt->writeConfig_FallingEdge(fallingEdge, status); -} diff --git a/hal/Azalea/src/main/native/NetworkCommunication/AICalibration.h b/hal/Azalea/src/main/native/NetworkCommunication/AICalibration.h deleted file mode 100644 index 1e86343204..0000000000 --- a/hal/Azalea/src/main/native/NetworkCommunication/AICalibration.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef __AICalibration_h__ -#define __AICalibration_h__ - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif - - uint32_t FRC_NetworkCommunication_nAICalibration_getLSBWeight(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status); - int32_t FRC_NetworkCommunication_nAICalibration_getOffset(const uint32_t aiSystemIndex, const uint32_t channel, int32_t *status); - -#ifdef __cplusplus -} -#endif - -#endif // __AICalibration_h__ diff --git a/hal/Azalea/src/main/native/NetworkCommunication/LoadOut.h b/hal/Azalea/src/main/native/NetworkCommunication/LoadOut.h deleted file mode 100644 index f28249e3f1..0000000000 --- a/hal/Azalea/src/main/native/NetworkCommunication/LoadOut.h +++ /dev/null @@ -1,39 +0,0 @@ - -#ifndef __LoadOut_h__ -#define __LoadOut_h__ - -#define kMaxModuleNumber 2 -namespace nLoadOut -{ - typedef enum { - kModuleType_Unknown = 0x00, - kModuleType_Analog = 0x01, - kModuleType_Digital = 0x02, - kModuleType_Solenoid = 0x03, - } tModuleType; - bool getModulePresence(tModuleType moduleType, uint8_t moduleNumber); - typedef enum { - kTargetClass_Unknown = 0x00, - kTargetClass_FRC1 = 0x10, - kTargetClass_FRC2 = 0x20, - kTargetClass_FRC2_Analog = kTargetClass_FRC2 | kModuleType_Analog, - kTargetClass_FRC2_Digital = kTargetClass_FRC2 | kModuleType_Digital, - kTargetClass_FRC2_Solenoid = kTargetClass_FRC2 | kModuleType_Solenoid, - kTargetClass_FamilyMask = 0xF0, - kTargetClass_ModuleMask = 0x0F, - } tTargetClass; - tTargetClass getTargetClass(); -} - -#ifdef __cplusplus -extern "C" { -#endif - - uint32_t FRC_NetworkCommunication_nLoadOut_getModulePresence(uint32_t moduleType, uint8_t moduleNumber); - uint32_t FRC_NetworkCommunication_nLoadOut_getTargetClass(); - -#ifdef __cplusplus -} -#endif - -#endif // __LoadOut_h__ diff --git a/hal/Azalea/src/main/native/Notifier.cpp b/hal/Azalea/src/main/native/Notifier.cpp deleted file mode 100644 index 8d9766b6c3..0000000000 --- a/hal/Azalea/src/main/native/Notifier.cpp +++ /dev/null @@ -1,40 +0,0 @@ - -#include "HAL/Notifier.h" - -#include "ChipObject.h" - -static const uint32_t kTimerInterruptNumber = 28; - -struct notifier_t { - tAlarm *alarm; - tInterruptManager *manager; -}; -typedef struct notifier_t Notifier; - -void* initializeNotifier(void (*ProcessQueue)(uint32_t, void*), int32_t *status) { - Notifier* notifier = new Notifier(); - notifier->manager = new tInterruptManager(1 << kTimerInterruptNumber, false, status); - notifier->manager->registerHandler(ProcessQueue, NULL, status); - notifier->manager->enable(status); - notifier->alarm = tAlarm::create(status); - return notifier; -} - -void cleanNotifier(void* notifier_pointer, int32_t *status) { - Notifier* notifier = (Notifier*) notifier_pointer; - notifier->alarm->writeEnable(false, status); - delete notifier->alarm; - notifier->alarm = NULL; - notifier->manager->disable(status); - delete notifier->manager; - notifier->manager = NULL; -} - - -void updateNotifierAlarm(void* notifier_pointer, uint32_t triggerTime, int32_t *status) { - Notifier* notifier = (Notifier*) notifier_pointer; - // write the first item in the queue into the trigger time - notifier->alarm->writeTriggerTime(triggerTime, status); - // Enable the alarm. The hardware disables itself after each alarm. - notifier->alarm->writeEnable(true, status); -} diff --git a/hal/Azalea/src/main/native/Port.h b/hal/Azalea/src/main/native/Port.h deleted file mode 100644 index 4d68312bb7..0000000000 --- a/hal/Azalea/src/main/native/Port.h +++ /dev/null @@ -1,11 +0,0 @@ - -#ifndef HAL_PORT_H -#define HAL_PORT_H - -struct port_t { - uint32_t pin; - uint8_t module; -}; -typedef struct port_t Port; - -#endif diff --git a/hal/Azalea/src/main/native/Semaphore.cpp b/hal/Azalea/src/main/native/Semaphore.cpp deleted file mode 100644 index bdbe6b88b5..0000000000 --- a/hal/Azalea/src/main/native/Semaphore.cpp +++ /dev/null @@ -1,79 +0,0 @@ - -#include "HAL/Semaphore.h" - -#include "ChipObject.h" - -const uint32_t SEMAPHORE_Q_FIFO = SEM_Q_FIFO; -const uint32_t SEMAPHORE_Q_PRIORITY = SEM_Q_PRIORITY; -const uint32_t SEMAPHORE_DELETE_SAFE = SEM_DELETE_SAFE; -const uint32_t SEMAPHORE_INVERSION_SAFE = SEM_INVERSION_SAFE; - -const int32_t SEMAPHORE_NO_WAIT = NO_WAIT; -const int32_t SEMAPHORE_WAIT_FOREVER = WAIT_FOREVER; - -const uint32_t SEMAPHORE_EMPTY = SEM_EMPTY; -const uint32_t SEMAPHORE_FULL = SEM_FULL; - -MUTEX_ID initializeMutex(uint32_t flags) { - return semMCreate(flags); -} - -void deleteMutex(MUTEX_ID sem) { - semDelete(sem); -} - -/** - * Lock the semaphore, blocking until it's available. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t takeMutex(MUTEX_ID sem, int32_t timeout) { - return semTake(sem, timeout); -} -/** - * Unlock the semaphore. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t giveMutex(MUTEX_ID sem) { - return semGive(sem); -} - - -SEMAPHORE_ID initializeSemaphore(uint32_t flags, uint32_t initial_state) { - return semBCreate(flags, (SEM_B_STATE) initial_state); -} - -void deleteSemaphore(SEMAPHORE_ID sem) { - semDelete(sem); -} - -/** - * Lock the semaphore, blocking until it's available. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t takeSemaphore(SEMAPHORE_ID sem, int32_t timeout) { - return semTake(sem, timeout); -} -/** - * Unlock the semaphore. - * @return 0 for success, -1 for error. If -1, the error will be in errno. - */ -int8_t giveSemaphore(SEMAPHORE_ID sem) { - return semGive(sem); -} - - -MULTIWAIT_ID initializeMultiWait() { - return initializeSemaphore(SEMAPHORE_Q_PRIORITY, SEMAPHORE_FULL); -} - -void deleteMultiWait(MULTIWAIT_ID sem) { - deleteSemaphore(sem); -} - -int8_t takeMultiWait(MULTIWAIT_ID sem, int32_t timeout) { - return takeSemaphore(sem, timeout); -} - -int8_t giveMultiWait(MULTIWAIT_ID sem) { - return semFlush(sem); -} diff --git a/hal/Azalea/src/main/native/Solenoid.cpp b/hal/Azalea/src/main/native/Solenoid.cpp deleted file mode 100644 index 6dc822ed73..0000000000 --- a/hal/Azalea/src/main/native/Solenoid.cpp +++ /dev/null @@ -1,73 +0,0 @@ - -#include "HAL/Solenoid.h" - -#include "Port.h" -#include "HAL/Errors.h" -#include "ChipObject.h" -#include "HAL/cpp/Synchronized.h" -#include "NetworkCommunication/LoadOut.h" - -struct solenoid_port_t { - Port port; - tSolenoid *module; - uint32_t PWMGeneratorID; -}; -typedef struct solenoid_port_t SolenoidPort; - -static ReentrantSemaphore solenoidSemaphore; -static tSolenoid* solenoidModules[2] = {NULL, NULL}; - -bool solenoidModulesInitialized = false; - -/** - * Initialize the digital modules. - */ -void initializeSolenoid(int32_t *status) { - if (solenoidModulesInitialized) return; - - for (unsigned int i = 0; i < (sizeof(solenoidModules)/sizeof(solenoidModules[0])); i++) { - Synchronized sync(solenoidSemaphore); - solenoidModules[i] = tSolenoid::create(status); - } - solenoidModulesInitialized = true; -} - -void* initializeSolenoidPort(void* port_pointer, int32_t *status) { - initializeSolenoid(status); - Port* port = (Port*) port_pointer; - - // Initialize port structure - SolenoidPort* solenoid_port = new SolenoidPort(); - solenoid_port->port = *port; - solenoid_port->module = solenoidModules[solenoid_port->port.module-1]; - - return solenoid_port; -} - -bool checkSolenoidModule(uint8_t module) { - if (nLoadOut::getModulePresence(nLoadOut::kModuleType_Solenoid, module - 1)) - return true; - return false; -} - -bool getSolenoid(void* solenoid_port_pointer, int32_t *status) { - SolenoidPort* port = (SolenoidPort*) solenoid_port_pointer; - if (checkSolenoidModule(port->port.module)) { - uint8_t mask = 1 << (port->port.pin - 1); - return (mask & port->module->readDO7_0(port->port.module - 1, status)); - } - return false; -} - -void setSolenoid(void* solenoid_port_pointer, bool value, int32_t *status) { - SolenoidPort* port = (SolenoidPort*) solenoid_port_pointer; - if (checkSolenoidModule(port->port.module)) { - Synchronized sync(solenoidSemaphore); - uint8_t currentValue = port->module->readDO7_0(port->port.module - 1, status); - uint8_t mask = 1 << (port->port.pin - 1); - if (value) currentValue = currentValue | mask; // Flip the bit on - else currentValue = currentValue & ~mask; // Flip the bit off - port->module->writeDO7_0(port->port.module - 1, currentValue, status); - } -} - diff --git a/hal/Azalea/src/main/native/Task.cpp b/hal/Azalea/src/main/native/Task.cpp deleted file mode 100644 index 65f7246515..0000000000 --- a/hal/Azalea/src/main/native/Task.cpp +++ /dev/null @@ -1,64 +0,0 @@ - -#include "HAL/Task.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" -#include -#include - -const uint32_t VXWORKS_FP_TASK = VX_FP_TASK; -const int32_t HAL_objLib_OBJ_ID_ERROR = S_objLib_OBJ_ID_ERROR; -const int32_t HAL_objLib_OBJ_DELETED = S_objLib_OBJ_DELETED; -const int32_t HAL_taskLib_ILLEGAL_OPTIONS = S_taskLib_ILLEGAL_OPTIONS; -const int32_t HAL_memLib_NOT_ENOUGH_MEMORY = S_memLib_NOT_ENOUGH_MEMORY; -const int32_t HAL_taskLib_ILLEGAL_PRIORITY = S_taskLib_ILLEGAL_PRIORITY; - -TASK spawnTask(char * name, int priority, int options, int stackSize, - FUNCPTR entryPt, uint32_t arg0, uint32_t arg1, uint32_t arg2, - uint32_t arg3, uint32_t arg4, uint32_t arg5, uint32_t arg6, - uint32_t arg7, uint32_t arg8, uint32_t arg9) { - return taskSpawn(name, - priority, - options, // options - stackSize, // stack size - entryPt, // function to start - arg0, arg1, arg2, arg3, arg4, // parameter 1 - pointer to this class - arg5, arg6, arg7, arg8, arg9);// additional unused parameters - -} - -STATUS restartTask(TASK task) { - return taskRestart(task); -} - -STATUS deleteTask(TASK task) { - return taskDelete(task); -} - -STATUS isTaskReady(TASK task) { - return taskIsReady(task); -} - -STATUS isTaskSuspended(TASK task) { - return taskIsSuspended(task); -} - -STATUS suspendTask(TASK task) { - return taskSuspend(task); -} - -STATUS resumeTask(TASK task) { - return taskResume(task); -} - -STATUS verifyTaskID(TASK task) { - return taskIdVerify(task); -} - -STATUS setTaskPriority(TASK task, int priority) { - return taskPrioritySet(task, priority); -} - -STATUS getTaskPriority(TASK task, int* priority) { - return taskPriorityGet(task, priority); -} diff --git a/hal/Azalea/src/main/native/Utilities.cpp b/hal/Azalea/src/main/native/Utilities.cpp deleted file mode 100644 index 5597aad72b..0000000000 --- a/hal/Azalea/src/main/native/Utilities.cpp +++ /dev/null @@ -1,23 +0,0 @@ - -#include "HAL/Utilities.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" - -#include // for taskDelay -#include // for sysClkRateGet - -const int32_t HAL_NO_WAIT = NO_WAIT; -const int32_t HAL_WAIT_FOREVER = WAIT_FOREVER; - -void delayTicks(int32_t ticks) { - taskDelay(ticks); -} - -void delayMillis(double ms) { - taskDelay((int32_t)((double)sysClkRateGet() * ms / 1000)); -} - -void delaySeconds(double s) { - taskDelay((int32_t)((double)sysClkRateGet() * s)); -} diff --git a/hal/Azalea/src/main/native/Watchdog.cpp b/hal/Azalea/src/main/native/Watchdog.cpp deleted file mode 100644 index 59e2041ab3..0000000000 --- a/hal/Azalea/src/main/native/Watchdog.cpp +++ /dev/null @@ -1,140 +0,0 @@ - -#include "HAL/Watchdog.h" - -#include "HAL/HAL.h" -#include "ChipObject.h" - -typedef tWatchdog Watchdog; -const double kDefaultWatchdogExpiration = 0.5; - -void* initializeWatchdog(int32_t *status) { - Watchdog* watchdog = tWatchdog::create(status); - setWatchdogExpiration(watchdog, kDefaultWatchdogExpiration, status); - setWatchdogEnabled(watchdog, true, status); - return watchdog; -} - -void cleanWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - setWatchdogEnabled(watchdog, false, status); - delete watchdog; -} - -/** - * Throw the dog a bone. - * - * When everything is going well, you feed your dog when you get home. - * Let's hope you don't drive your car off a bridge on the way home... - * Your dog won't get fed and he will starve to death. - * - * By the way, it's not cool to ask the neighbor (some random task) to - * feed your dog for you. He's your responsibility! - * - * @returns Returns the previous state of the watchdog before feeding it. - */ -bool feedWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool previous = getWatchdogEnabled(watchdog_pointer, status); - watchdog->strobeFeed(status); - return previous; -} - -/** - * Put the watchdog out of its misery. - * - * Don't wait for your dying robot to starve when there is a problem. - * Kill it quickly, cleanly, and humanely. - */ -void killWatchdog(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->strobeKill(status); -} - -/** - * Read how long it has been since the watchdog was last fed. - * - * @return The number of seconds since last meal. - */ -double getWatchdogLastFed(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - uint32_t timer = watchdog->readTimer(status); - return timer / (kSystemClockTicksPerMicrosecond * 1e6); -} - -/** - * Read what the current expiration is. - * - * @return The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -double getWatchdogExpiration(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - uint32_t expiration = watchdog->readExpiration(status); - return expiration / (kSystemClockTicksPerMicrosecond * 1e6); -} - -/** - * Configure how many seconds your watchdog can be neglected before it starves to death. - * - * @param expiration The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -void setWatchdogExpiration(void* watchdog_pointer, double expiration, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->writeExpiration((uint32_t)(expiration * (kSystemClockTicksPerMicrosecond * 1e6)), status); -} - -/** - * Find out if the watchdog is currently enabled or disabled (mortal or immortal). - * - * @return Enabled or disabled. - */ -bool getWatchdogEnabled(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool enabled = !watchdog->readImmortal(status); - return enabled; -} - -/** - * Enable or disable the watchdog timer. - * - * When enabled, you must keep feeding the watchdog timer to - * keep the watchdog active, and hence the dangerous parts - * (motor outputs, etc.) can keep functioning. - * When disabled, the watchdog is immortal and will remain active - * even without being fed. It will also ignore any kill commands - * while disabled. - * - * @param enabled Enable or disable the watchdog. - */ -void setWatchdogEnabled(void* watchdog_pointer, bool enabled, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - watchdog->writeImmortal(!enabled, status); -} - -/** - * Check in on the watchdog and make sure he's still kicking. - * - * This indicates that your watchdog is allowing the system to operate. - * It is still possible that the network communications is not allowing the - * system to run, but you can check this to make sure it's not your fault. - * Check IsSystemActive() for overall system status. - * - * If the watchdog is disabled, then your watchdog is immortal. - * - * @return Is the watchdog still alive? - */ -bool isWatchdogAlive(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool alive = watchdog->readStatus_Alive(status); - return alive; -} - -/** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ -bool isWatchdogSystemActive(void* watchdog_pointer, int32_t *status) { - Watchdog* watchdog = (Watchdog*) watchdog_pointer; - bool alive = watchdog->readStatus_SystemActive(status); - return alive; -} diff --git a/hal/Azalea/src/main/native/cpp/Resource.cpp b/hal/Azalea/src/main/native/cpp/Resource.cpp deleted file mode 100644 index 4ef0f324b1..0000000000 --- a/hal/Azalea/src/main/native/cpp/Resource.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "HAL/cpp/Resource.h" -#include "HAL/Errors.h" - -ReentrantSemaphore Resource::m_createLock; - -/** - * Allocate storage for a new instance of Resource. - * Allocate a bool array of values that will get initialized to indicate that no resources - * have been allocated yet. The indicies of the resources are [0 .. elements - 1]. - */ -Resource::Resource(uint32_t elements) -{ - Synchronized sync(m_createLock); - m_size = elements; - m_isAllocated = new bool[m_size]; - for (uint32_t i=0; i < m_size; i++) - { - m_isAllocated[i] = false; - } -} - -/** - * Factory method to create a Resource allocation-tracker *if* needed. - * - * @param r -- address of the caller's Resource pointer. If *r == NULL, this - * will construct a Resource and make *r point to it. If *r != NULL, i.e. - * the caller already has a Resource instance, this won't do anything. - * @param elements -- the number of elements for this Resource allocator to - * track, that is, it will allocate resource numbers in the range - * [0 .. elements - 1]. - */ -/*static*/ void Resource::CreateResourceObject(Resource **r, uint32_t elements) -{ - Synchronized sync(m_createLock); - if (*r == NULL) - { - *r = new Resource(elements); - } -} - -/** - * Delete the allocated array or resources. - * This happens when the module is unloaded (provided it was statically allocated). - */ -Resource::~Resource() -{ - delete[] m_isAllocated; -} - -/** - * Allocate a resource. - * When a resource is requested, mark it allocated. In this case, a free resource value - * within the range is located and returned after it is marked allocated. - */ -uint32_t Resource::Allocate(const char *resourceDesc) -{ - Synchronized sync(m_allocateLock); - for (uint32_t i=0; i < m_size; i++) - { - if (!m_isAllocated[i]) - { - m_isAllocated[i] = true; - return i; - } - } - // TODO: wpi_setWPIErrorWithContext(NoAvailableResources, resourceDesc); - return ~0ul; -} - -/** - * Allocate a specific resource value. - * The user requests a specific resource value, i.e. channel number and it is verified - * unallocated, then returned. - */ -uint32_t Resource::Allocate(uint32_t index, const char *resourceDesc) -{ - Synchronized sync(m_allocateLock); - if (index >= m_size) - { - // TODO: wpi_setWPIErrorWithContext(ChannelIndexOutOfRange, resourceDesc); - return ~0ul; - } - if ( m_isAllocated[index] ) - { - // TODO: wpi_setWPIErrorWithContext(ResourceAlreadyAllocated, resourceDesc); - return ~0ul; - } - m_isAllocated[index] = true; - return index; -} - - -/** - * Free an allocated resource. - * After a resource is no longer needed, for example a destructor is called for a channel assignment - * class, Free will release the resource value so it can be reused somewhere else in the program. - */ -void Resource::Free(uint32_t index) -{ - Synchronized sync(m_allocateLock); - if (index == ~0ul) return; - if (index >= m_size) - { - // TODO: wpi_setWPIError(NotAllocated); - return; - } - if (!m_isAllocated[index]) - { - // TODO: wpi_setWPIError(NotAllocated); - return; - } - m_isAllocated[index] = false; -} diff --git a/hal/Azalea/src/main/native/cpp/StackTrace.cpp b/hal/Azalea/src/main/native/cpp/StackTrace.cpp deleted file mode 100644 index 6613bb7b4f..0000000000 --- a/hal/Azalea/src/main/native/cpp/StackTrace.cpp +++ /dev/null @@ -1,165 +0,0 @@ - -#include "HAL/cpp/StackTrace.h" - -#include "HAL/HAL.h" -#include "../ChipObject.h" -#include -#include -#include -#include -#include - -#define DBG_DEMANGLE_PRINT_LEN 256 /* Num chars of demangled names to print */ - -extern "C" -{ - extern char * cplusDemangle (char *source, char *dest, int32_t n); -} - -char *wpi_getLabel(uint16_t addr, int32_t *found) -{ - int pVal; - SYM_TYPE pType; - char name[MAX_SYS_SYM_LEN + 1]; - static char label[DBG_DEMANGLE_PRINT_LEN + 1 + 11]; - bzero(label, DBG_DEMANGLE_PRINT_LEN + 1 + 11); - - if (symFindByValue(sysSymTbl, addr, name, &pVal, &pType) == OK) - { - cplusDemangle(name, label, sizeof(label) - 11); - if ((uint16_t)pVal != addr) - { - sprintf(&label[strlen(label)], "+0x%04x", addr-pVal); - if (found) *found = 2; - } - else - { - if (found) *found = 1; - } - } - else - { - sprintf(label, "0x%04x", addr); - if (found) *found = 0; - } - - return label; -} -/* -static void wpiTracePrint(INSTR *caller, int32_t func, int32_t nargs, int32_t *args, int32_t taskId, BOOL isKernelAdrs) -{ - char buf [MAX_SYS_SYM_LEN * 2]; - int32_t ix; - int32_t len = 0; - len += sprintf (&buf [len], "%s <%#010x>: ", wpi_getLabel((uint32_t)caller), (int32_t)caller); - len += sprintf (&buf [len], "%s <%#010x> (", wpi_getLabel((uint32_t)func), func); - for (ix = 0; ix < nargs; ix++) - { - if (ix != 0) - len += sprintf (&buf [len], ", "); - len += sprintf (&buf [len], "%#x", args [ix]); - } - len += sprintf (&buf [len], ")\n"); - - printf(buf); -} -*/ -static void wpiCleanTracePrint(INSTR *caller, int32_t func, int32_t nargs, int32_t *args, int32_t taskId, BOOL isKernelAdrs) -{ - char buf [MAX_SYS_SYM_LEN]; - int32_t ix; - int32_t len = 0; - int32_t nameFound = 0; - int32_t params = 0; - int32_t totalnargs = nargs; - char *funcName = wpi_getLabel((uint32_t)func, &nameFound); - // Ignore names that are not exact symbol address matches. - if (nameFound != 1) return; - - // Ignore internal function name matches. - if (strncmp(funcName, "wpi_assert", 10) == 0) return; - if (strncmp(funcName, "wpi_fatal", 9) == 0) return; - if (strncmp(funcName, "wpi_selfTrace", 13) == 0) return; - if (strncmp(funcName, "Error::Set", 10) == 0) return; - if (strncmp(funcName, "ErrorBase::SetError", 19) == 0) return; - if (strncmp(funcName, "Error::Report", 13) == 0) return; - - // Find the number of arguments in the name string. - char *start = strchr(funcName, '('); - char *end = strrchr(funcName, ')'); - if (start + 1 != end && start != NULL) - { - do - { - params++; - if(strncmp(start+1, "bool", 4) == 0 || strncmp(start+2, "bool", 4) == 0) - { - totalnargs++; - } - start = strchr(start + 1, ','); - } - while(start < end && start != NULL); - } - char *funcNameEnd = strchr(funcName, '('); - *funcNameEnd = 0; - len += sprintf (&buf [len], funcName); - - // If this is a member function, print out the this pointer value. - if (totalnargs - params == 1) - { - len += sprintf (&buf [len], "", args [0]); - } - - // Print out the argument values. - len += sprintf (&buf [len], "("); - for (ix = totalnargs - params; ix < nargs; ix++) - { - if (ix != totalnargs - params) - len += sprintf (&buf [len], ", "); - len += sprintf (&buf [len], "%#lx", args [ix]); - } - len += sprintf (&buf [len], ")\n"); - - printf(buf); -} - -extern "C" -{ - extern void trcStack(REG_SET* pRegs, FUNCPTR printRtn, int32_t tid); -} - -static int32_t wpiStackTask(int32_t taskId) -{ - delayTicks(1); - //tt(taskId); - - REG_SET regs; - taskRegsGet(taskId, ®s); - trcStack(®s, (FUNCPTR) wpiCleanTracePrint, taskId); - printf("\n"); - - // The task should be resumed because it had to be suspended to get the stack trace. - taskResume(taskId); - return 0; -} - -void printCurrentStackTrace() -{ - int priority=100; - taskPriorityGet(0, &priority); - // Lower priority than the calling task. - // Task traceTask("StackTrace", (FUNCPTR)wpiStackTask, priority + 1); - // traceTask.Start(taskIdSelf()); - spawnTask("StackTrace", priority + 1, VXWORKS_FP_TASK, 20000, (FUNCPTR)wpiStackTask, taskIdSelf(), - 0, 0, 0, 0, 0, 0, 0, 0, 0); - - // Task to be traced must be suspended for the stack trace to work. - taskSuspend(0); -} - -bool getErrnoToName(int32_t errNo, char* name) { - int pval; - SYM_TYPE ptype; - symFindByValue(statSymTbl, errNo, name, &pval, &ptype); - return (pval == errNo); -} diff --git a/hal/Azalea/src/main/native/cpp/Synchronized.cpp b/hal/Azalea/src/main/native/cpp/Synchronized.cpp deleted file mode 100644 index b531c0e2b3..0000000000 --- a/hal/Azalea/src/main/native/cpp/Synchronized.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "HAL/cpp/Synchronized.h" - -/** - * Synchronized class deals with critical regions. - * Declare a Synchronized object at the beginning of a block. That will take the semaphore. - * When the code exits from the block it will call the destructor which will give the semaphore. - * This ensures that no matter how the block is exited, the semaphore will always be released. - * Use the CRITICAL_REGION(SEM_ID) and END_REGION macros to make the code look cleaner (see header file) - * @param semaphore The semaphore controlling this critical region. - */ -Synchronized::Synchronized(MUTEX_ID semaphore) -{ - m_semaphore = semaphore; - takeMutex(m_semaphore, SEMAPHORE_WAIT_FOREVER); -} - -Synchronized::Synchronized(ReentrantSemaphore& semaphore) -{ - m_semaphore = semaphore.m_semaphore; - takeMutex(m_semaphore, SEMAPHORE_WAIT_FOREVER); -} - -/** - * This destructor unlocks the semaphore. - */ -Synchronized::~Synchronized() -{ - giveMutex(m_semaphore); -} diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt new file mode 100644 index 0000000000..839d7e52cd --- /dev/null +++ b/hal/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 2.8) +project(HAL) +set(CMAKE_BUILD_TYPE Debug) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +file(GLOB_RECURSE SRC_FILES Athena/src/*.cpp) +include_directories(Athena/src/main/native include/src/main/include) +add_library(HALAthena SHARED ${SRC_FILES}) +# lib/ c m gcc_s ld-linux +# usr/lib stdc++ diff --git a/hal/include/src/main/include/HAL/HAL.h b/hal/include/src/main/include/HAL/HAL.h index 11c0c12d57..31a323fbd5 100644 --- a/hal/include/src/main/include/HAL/HAL.h +++ b/hal/include/src/main/include/HAL/HAL.h @@ -9,11 +9,11 @@ #else #include #endif +#include #include "Analog.h" #include "Digital.h" #include "Solenoid.h" -#include "Watchdog.h" #include "Notifier.h" #include "Interrupts.h" #include "Errors.h" @@ -244,11 +244,11 @@ struct HALCommonControlData{ inline float intToFloat(int value) { - return *(float*) &value; + return (float)value; } inline int floatToInt(float value) { - return *(int*) &value; + return round(value); } extern "C" { diff --git a/hal/include/src/main/include/HAL/Watchdog.h b/hal/include/src/main/include/HAL/Watchdog.h deleted file mode 100644 index 6b39f858d6..0000000000 --- a/hal/include/src/main/include/HAL/Watchdog.h +++ /dev/null @@ -1,27 +0,0 @@ - -#ifdef __vxworks -#include -#else -#include -#endif - -#ifndef HAL_WATCHDOG_H -#define HAL_WATCHDOG_H - -extern "C" { - extern const double kDefaultWatchdogExpiration; - - void* initializeWatchdog(int32_t *status); - void cleanWatchdog(void* watchdog_pointer, int32_t *status); - - bool feedWatchdog(void* watchdog_pointer, int32_t *status); - void killWatchdog(void* watchdog_pointer, int32_t *status); - double getWatchdogLastFed(void* watchdog_pointer, int32_t *status); - double getWatchdogExpiration(void* watchdog_pointer, int32_t *status); - void setWatchdogExpiration(void* watchdog_pointer, double expiration, int32_t *status); - bool getWatchdogEnabled(void* watchdog_pointer, int32_t *status); - void setWatchdogEnabled(void* watchdog_pointer, bool enabled, int32_t *status); - bool isWatchdogAlive(void* watchdog_pointer, int32_t *status); - bool isWatchdogSystemActive(void* watchdog_pointer, int32_t *status); -} -#endif diff --git a/hal/pom.xml b/hal/pom.xml index ebf71721fe..77425c1f76 100644 --- a/hal/pom.xml +++ b/hal/pom.xml @@ -9,35 +9,6 @@ include + Athena - - - - jenkins - - - myrepository - file:${local-repository} - - - - - athena - - true - - - Athena - - - - azalea - - false - - - Azalea - - - diff --git a/maven-utilities/athena/shared-library/pom.xml b/maven-utilities/athena/shared-library/pom.xml index 7aa2b61a3a..f1f9d49c92 100644 --- a/maven-utilities/athena/shared-library/pom.xml +++ b/maven-utilities/athena/shared-library/pom.xml @@ -26,7 +26,7 @@ export PATH=$HOME/wpilib/toolchains/arm-none-linux-gnueabi-4.4.1/bin/:$PATH --> arm-none-linux-gnueabi-g++ - -march=armv7 -mcpu=cortex-a9 -mfloat-abi=softfp -fPIC + -march=armv7-a -mcpu=cortex-a9 -mfloat-abi=softfp -fPIC -O0 -g3 -Wall diff --git a/maven-utilities/azalea/cpp-executable/pom.xml b/maven-utilities/azalea/cpp-executable/pom.xml deleted file mode 100644 index 3a72798a1d..0000000000 --- a/maven-utilities/azalea/cpp-executable/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.templates.azalea - cpp-executable - 0.1.0-SNAPSHOT - pom - - - UTF-8 - UTF-8 - C:/Users/wpilibj-buildmaster/maven-repository - - - - - - - org.codehaus.mojo - native-maven-plugin - 1.0-alpha-7 - true - - - ccppc - ccppc* - - - -g -mcpu=603 -mstrict-align -mno-implicit-fp -mlongcall -ansi -Wall -mlongcall -IC:/WindRiver/vxworks-6.3/target/h/wrn/coreip - - - -DCPU=PPC603 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL - - - - -r -nostdlib -Wl,-X -T C:/WindRiver/vxworks-6.3/target/h/tool/gnu/ldscripts/link.OUT - - - - - src/main/native - - **/*.cpp - - - - - - - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - - diff --git a/maven-utilities/azalea/library-jar/pom.xml b/maven-utilities/azalea/library-jar/pom.xml deleted file mode 100644 index 44080e33c4..0000000000 --- a/maven-utilities/azalea/library-jar/pom.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.templates.azalea - library-jar - pom - 0.1.0-SNAPSHOT - - - UTF-8 - UTF-8 - ${env.HOME}/sunspotfrcsdk - C:/Users/wpilibj-buildmaster/maven-repository - - - - - - com.sun.squawk - runtime - 0.1.0.qualifier - system - ${sunspot.home}/lib/squawk.jar - - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.1 - - 1.3 - 1.2 - true - true - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - preverify - compile - - exec - - - ${sunspot.home}/bin/preverify - compile - - -d - ${project.build.directory}/classes - -classpath - - ${project.build.directory}/classes - - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - package - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9.1 - - - attach-javadoc - package - - jar - - - - - - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - - diff --git a/maven-utilities/azalea/pom.xml b/maven-utilities/azalea/pom.xml deleted file mode 100644 index 4e060f9696..0000000000 --- a/maven-utilities/azalea/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.templates - azalea - pom - 0.1.0-SNAPSHOT - - - static-library - cpp-executable - library-jar - - - - C:/Users/wpilibj-buildmaster/maven-repository - - - - jenkins - - - myrepository - file:${local-repository} - - - - - diff --git a/maven-utilities/azalea/static-library/pom.xml b/maven-utilities/azalea/static-library/pom.xml deleted file mode 100644 index 01c1616731..0000000000 --- a/maven-utilities/azalea/static-library/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.templates.azalea - static-library - 0.1.0-SNAPSHOT - pom - - - UTF-8 - UTF-8 - C:/Users/wpilibj-buildmaster/maven-repository - - - - - - - org.codehaus.mojo - native-maven-plugin - 1.0-alpha-7 - true - - - ccppc - ar - arppc* - - - -g -mcpu=603 -mstrict-align -mno-implicit-fp -mlongcall -ansi -Wall -mlongcall -IC:/WindRiver/vxworks-6.3/target/h/wrn/coreip - - - -DCPU=PPC603 -DTOOL_FAMILY=gnu -DTOOL=gnu -D_WRS_KERNEL - - - - crus - - - - - src/main/native - - **/*.cpp - - - - src/main/include - - - true - - - - - - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - - diff --git a/maven-utilities/pom.xml b/maven-utilities/pom.xml index 8ad8371bfb..b43510fea0 100644 --- a/maven-utilities/pom.xml +++ b/maven-utilities/pom.xml @@ -9,22 +9,7 @@ athena - azalea include - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - diff --git a/networktables/cpp/.project b/networktables/cpp/.project index 49caed561d..16da7e8d4b 100644 --- a/networktables/cpp/.project +++ b/networktables/cpp/.project @@ -17,8 +17,14 @@ + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.m2e.core.maven2Nature org.eclipse.cdt.core.cnature org.eclipse.cdt.core.ccnature org.eclipse.cdt.managedbuilder.core.managedBuildNature diff --git a/networktables/cpp/Azalea/pom.xml b/networktables/cpp/Azalea/pom.xml deleted file mode 100644 index 9ffc6c4325..0000000000 --- a/networktables/cpp/Azalea/pom.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.networktables.cpp - libNetworkTablesAzalea - a - - - edu.wpi.first.wpilib.templates.azalea - static-library - 0.1.0-SNAPSHOT - ../../../maven-utilities/azalea/static-library/pom.xml - - - - - edu.wpi.first.wpilib.networktables.cpp - include - 0.1.0-SNAPSHOT - inczip - - - - - - - org.codehaus.mojo - native-maven-plugin - - - - src/main/native - - **/*.cpp - - - - ../parent/src/main/native - - **/*.cpp - - - - - - - - diff --git a/networktables/cpp/Azalea/src/main/native/OSAL/Synchronized.cpp b/networktables/cpp/Azalea/src/main/native/OSAL/Synchronized.cpp deleted file mode 100644 index 53aa960c7d..0000000000 --- a/networktables/cpp/Azalea/src/main/native/OSAL/Synchronized.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "OSAL/Synchronized.h" - -/** - * Synchronized class deals with critical regions. - * Declare a Synchronized object at the beginning of a block. That will take the semaphore. - * When the code exits from the block it will call the destructor which will give the semaphore. - * This ensures that no matter how the block is exited, the semaphore will always be released. - * Use the CRITICAL_REGION(SEM_ID) and END_REGION macros to make the code look cleaner (see header file) - * @param semaphore The semaphore controlling this critical region. - */ -NTSynchronized::NTSynchronized(SEM_ID semaphore) -{ - usingSem = false; - m_semaphore = semaphore; - semTake(m_semaphore, WAIT_FOREVER); -} - -NTSynchronized::NTSynchronized(NTReentrantSemaphore& sem) -{ - usingSem = true; - m_sem = &sem; - m_sem->take(); -} - -/** - * Syncronized destructor. - * This destructor frees the semaphore ensuring that the resource is freed for the block - * containing the Synchronized object. - */ -NTSynchronized::~NTSynchronized() -{ - if(usingSem) - m_sem->give(); - else - semGive(m_semaphore); -} diff --git a/networktables/cpp/Azalea/src/main/native/OSAL/Task.cpp b/networktables/cpp/Azalea/src/main/native/OSAL/Task.cpp deleted file mode 100644 index 083d78df6d..0000000000 --- a/networktables/cpp/Azalea/src/main/native/OSAL/Task.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "OSAL/Task.h" - -#include -#include -#include -#include - -const UINT32 NTTask::kDefaultPriority; -const INT32 NTTask::kInvalidTaskID; - -/** - * Create but don't launch a task. - * @param name The name of the task. "FRC_" will be prepended to the task name. - * @param function The address of the function to run as the new task. - * @param priority The VxWorks priority for the task. - * @param stackSize The size of the stack for the task - */ -NTTask::NTTask(const char* name, FUNCPTR function, INT32 priority, UINT32 stackSize) -{ - m_taskID = kInvalidTaskID; - m_function = function; - m_priority = priority; - m_stackSize = stackSize; - m_taskName = new char[strlen(name) + 5]; - strcpy(m_taskName, "FRC_"); - strcpy(m_taskName+4, name); - - static INT32 instances = 0; - instances++; - //nUsageReporting::report(nUsageReporting::kResourceType_Task, instances, 0, m_taskName); -} - -NTTask::~NTTask() -{ - if (m_taskID != kInvalidTaskID) Stop(); - delete [] m_taskName; - m_taskName = NULL; -} - -/** - * Starts this task. - * If it is already running or unable to start, it fails and returns false. - */ -bool NTTask::Start(UINT32 arg0, UINT32 arg1, UINT32 arg2, UINT32 arg3, UINT32 arg4, - UINT32 arg5, UINT32 arg6, UINT32 arg7, UINT32 arg8, UINT32 arg9) -{ - m_taskID = taskSpawn(m_taskName, - m_priority, - VX_FP_TASK, // options - m_stackSize, // stack size - m_function, // function to start - arg0, arg1, arg2, arg3, arg4, // parameter 1 - pointer to this class - arg5, arg6, arg7, arg8, arg9);// additional unused parameters - bool ok = HandleError(m_taskID); - if (!ok) m_taskID = kInvalidTaskID; - return ok; -} - -/** - * Restarts a running task. - * If the task isn't started, it starts it. - * @return false if the task is running and we are unable to kill the previous instance - */ -bool NTTask::Restart() -{ - return HandleError(taskRestart(m_taskID)); -} - -/** - * Kills the running task. - * @returns true on success false if the task doesn't exist or we are unable to kill it. - */ -bool NTTask::Stop() -{ - bool ok = true; - if (Verify()) - { - ok = HandleError(taskDelete(m_taskID)); - } - m_taskID = kInvalidTaskID; - return ok; -} - -/** - * Returns true if the task is ready to execute (i.e. not suspended, delayed, or blocked). - * @return true if ready, false if not ready. - */ -bool NTTask::IsReady() -{ - return taskIsReady(m_taskID); -} - -/** - * Returns true if the task was explicitly suspended by calling Suspend() - * @return true if suspended, false if not suspended. - */ -bool NTTask::IsSuspended() -{ - return taskIsSuspended(m_taskID); -} - -/** - * Pauses a running task. - * Returns true on success, false if unable to pause or the task isn't running. - */ -bool NTTask::Suspend() -{ - return HandleError(taskSuspend(m_taskID)); -} - -/** - * Resumes a paused task. - * Returns true on success, false if unable to resume or if the task isn't running/paused. - */ -bool NTTask::Resume() -{ - return HandleError(taskResume(m_taskID)); -} - -/** - * Verifies a task still exists. - * @returns true on success. - */ -bool NTTask::Verify() -{ - return taskIdVerify(m_taskID) == OK; -} - -/** - * Gets the priority of a task. - * @returns task priority or 0 if an error occured - */ -INT32 NTTask::GetPriority() -{ - if (HandleError(taskPriorityGet(m_taskID, &m_priority))) - return m_priority; - else - return 0; -} - -/** - * This routine changes a task's priority to a specified priority. - * Priorities range from 0, the highest priority, to 255, the lowest priority. - * Default task priority is 100. - * @param priority The priority the task should run at. - * @returns true on success. - */ -bool NTTask::SetPriority(INT32 priority) -{ - m_priority = priority; - return HandleError(taskPrioritySet(m_taskID, m_priority)); -} - -/** - * Returns the name of the task. - * @returns Pointer to the name of the task or NULL if not allocated - */ -const char* NTTask::GetName() -{ - return m_taskName; -} - -/** - * Get the ID of a task - * @returns Task ID of this task. Task::kInvalidTaskID (-1) if the task has not been started or has already exited. - */ -INT32 NTTask::GetID() -{ - if (Verify()) - return m_taskID; - return kInvalidTaskID; -} - -/** - * Handles errors generated by task related code. - */ -bool NTTask::HandleError(STATUS results) -{ - if (results != ERROR) return true; - switch(errnoGet()) - { - case S_objLib_OBJ_ID_ERROR: - wpi_setWPIErrorWithContext(TaskIDError, m_taskName); - break; - - case S_objLib_OBJ_DELETED: - wpi_setWPIErrorWithContext(TaskDeletedError, m_taskName); - break; - - case S_taskLib_ILLEGAL_OPTIONS: - wpi_setWPIErrorWithContext(TaskOptionsError, m_taskName); - break; - - case S_memLib_NOT_ENOUGH_MEMORY: - wpi_setWPIErrorWithContext(TaskMemoryError, m_taskName); - break; - - case S_taskLib_ILLEGAL_PRIORITY: - wpi_setWPIErrorWithContext(TaskPriorityError, m_taskName); - break; - - default: - printErrno(errnoGet()); - wpi_setWPIErrorWithContext(TaskError, m_taskName); - } - return false; -} - diff --git a/networktables/cpp/Azalea/src/main/native/networktables2/stream/FDIOStream.cpp b/networktables/cpp/Azalea/src/main/native/networktables2/stream/FDIOStream.cpp deleted file mode 100644 index d0dd657c9b..0000000000 --- a/networktables/cpp/Azalea/src/main/native/networktables2/stream/FDIOStream.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * FDIOStream.cpp - * - * Created on: Sep 27, 2012 - * Author: Mitchell Wills - */ - -#include "networktables2/stream/FDIOStream.h" -#include "networktables2/util/IOException.h" -#include "networktables2/util/EOFException.h" - -#include -#include -#include -#include -#include -#include - - -FDIOStream::FDIOStream(int _fd){ - fd = _fd; - // f = fdopen(_fd, "rbwb"); - // if(f==NULL) - // throw IOException("Could not open stream from file descriptor", errno); -} -FDIOStream::~FDIOStream(){ - close(); -} - -int FDIOStream::read(void* ptr, int numbytes){ - if(numbytes==0) - return 0; - char* bufferPointer = (char*)ptr; - int totalRead = 0; - - struct timeval timeout; - fd_set fdSet; - - while (totalRead < numbytes) { - FD_ZERO(&fdSet); - FD_SET(fd, &fdSet); - timeout.tv_sec = 1; - timeout.tv_usec = 0; - int select_result = select(FD_SETSIZE, &fdSet, NULL, NULL, &timeout); - if ( select_result < 0) - throw IOException("Select returned an error on read"); - - int numRead = 0; - if (FD_ISSET(fd, &fdSet)) { - numRead = ::read(fd, bufferPointer, numbytes-totalRead); - - if(numRead == 0){ - throw EOFException(); - } - else if (numRead < 0) { - perror("read error: "); - fflush(stderr); - throw IOException("Error on FDIO read"); - } - bufferPointer += numRead; - totalRead += numRead; - } - } - return totalRead; -} -int FDIOStream::write(const void* ptr, int numbytes){ - int numWrote = ::write(fd, (char*)ptr, numbytes);//TODO: this is bad - //int numWrote = fwrite(ptr, 1, numbytes, f); - if(numWrote==numbytes) - return numWrote; - perror("write error: "); - fflush(stderr); - throw IOException("Could not write all bytes to fd stream"); - -} -void FDIOStream::flush(){ - //if(fflush(f)==EOF) - // throw EOFException(); -} -void FDIOStream::close(){ - //fclose(f);//ignore any errors closing - ::close(fd); -} - diff --git a/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketServerStreamProvider.cpp b/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketServerStreamProvider.cpp deleted file mode 100644 index cf1175ce14..0000000000 --- a/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketServerStreamProvider.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * SocketServerStreamProvider.cpp - * - * Created on: Sep 27, 2012 - * Author: Mitchell Wills - */ - -#include "networktables2/stream/SocketServerStreamProvider.h" -#include "networktables2/stream/FDIOStream.h" -#include "networktables2/util/IOException.h" - -#include -#include -#include -#ifdef _WRS_KERNEL -#include -#include -#include -#include -#include -#include -#include -#include -#else -#include -#include -#include -#include -#ifdef WIN32 -#include -#include -#include -#include -#include -#else -#include -#include -#include -#include -#endif -#endif - -#ifndef _WRS_KERNEL -#define ERROR -1 -#endif - -#if defined(WIN32) || defined(_WRS_KERNEL) -typedef int addrlen_t; -#else -typedef socklen_t addrlen_t; -#endif - - -SocketServerStreamProvider::SocketServerStreamProvider(int port){ - struct sockaddr_in serverAddr; - int sockAddrSize = sizeof(serverAddr); - memset(&serverAddr, 0, sockAddrSize); - -#ifdef _WRS_KERNEL - serverAddr.sin_len = (u_char)sockAddrSize; -#endif - serverAddr.sin_family = AF_INET; - serverAddr.sin_port = htons(port); - serverAddr.sin_addr.s_addr = htonl(INADDR_ANY); - - if ((serverSocket = socket(AF_INET, SOCK_STREAM, 0)) == ERROR) - { - throw IOException("Error creating server socket", errno); - } - - // Set the TCP socket so that it can be reused if it is in the wait state. - int reuseAddr = 1; - setsockopt(serverSocket, SOL_SOCKET, SO_REUSEADDR, (char *)&reuseAddr, sizeof(reuseAddr)); - - // Bind socket to local address. - if (bind(serverSocket, (struct sockaddr *)&serverAddr, sockAddrSize) == ERROR) - { - ::close(serverSocket); - throw IOException("Could not bind server socket", errno); - } - - if (listen(serverSocket, 1) == ERROR) - { - ::close(serverSocket); - throw IOException("Could not listen on server socket", errno); - } -} -SocketServerStreamProvider::~SocketServerStreamProvider(){ - close(); -} - - -IOStream* SocketServerStreamProvider::accept(){ - struct timeval timeout; - // Check for a shutdown once per second - while (true) - { - fd_set fdSet; - - FD_ZERO(&fdSet); - FD_SET(serverSocket, &fdSet); - timeout.tv_sec = 1; - timeout.tv_usec = 0; - int select_result = select(FD_SETSIZE, &fdSet, NULL, NULL, &timeout); - if ( select_result < 0) - return NULL; - - if (FD_ISSET(serverSocket, &fdSet)) - { - struct sockaddr clientAddr; - memset(&clientAddr, 0, sizeof(struct sockaddr)); - addrlen_t clientAddrSize = sizeof(clientAddr); - int connectedSocket = ::accept(serverSocket, &clientAddr, &clientAddrSize); - if (connectedSocket == ERROR) - return NULL; - - return new FDIOStream(connectedSocket); - } - - - } - return NULL; -} - -void SocketServerStreamProvider::close(){ - ::close(serverSocket); -} diff --git a/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketStreamFactory.cpp b/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketStreamFactory.cpp deleted file mode 100644 index 1033998361..0000000000 --- a/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketStreamFactory.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * SocketStreamFactory.cpp - * - * Created on: Nov 3, 2012 - * Author: Mitchell Wills - */ - - -#include -#ifdef _WRS_KERNEL -#else - #include - #include - #include - #include - #ifdef WIN32 - #include - #include - #else - #include - #include - #include - #include - #include - #endif -#endif -#include "networktables2/stream/FDIOStream.h" -#include "networktables2/stream/SocketStreamFactory.h" - - -SocketStreamFactory::SocketStreamFactory(const char* _host, int _port):host(_host), port(_port){} - -SocketStreamFactory::~SocketStreamFactory(){} - -IOStream* SocketStreamFactory::createStream(){ -#ifdef _WRS_KERNEL - //crio client not supported - return NULL; -#else - struct sockaddr_in serv_addr; - struct hostent *server; - - int sockfd = socket(AF_INET, SOCK_STREAM, 0); - if (sockfd < 0){ - //error("ERROR opening socket"); - return NULL; - } - server = gethostbyname(host); - if (server == NULL) { - //fprintf(stderr,"ERROR, no such host\n"); - return NULL; - } - memset(&serv_addr, 0, sizeof(serv_addr)); - serv_addr.sin_family = AF_INET; - memcpy(&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length); - serv_addr.sin_port = htons(port); - if (connect(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)) < 0) { - //error("ERROR connecting"); - return NULL; - }//TODO close fd if an error occured - - //int on = 1; - //setsockopt(sockfd, IPPROTO_TCP, TCP_NODELAY, (char *)&on, sizeof(on)); - - return new FDIOStream(sockfd); -#endif -} diff --git a/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketStreams.cpp b/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketStreams.cpp deleted file mode 100644 index 6eaf65add1..0000000000 --- a/networktables/cpp/Azalea/src/main/native/networktables2/stream/SocketStreams.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* - * SocketStreams.cpp - * - * Created on: Sep 27, 2012 - * Author: Mitchell Wills - */ - -#include "networktables2/stream/SocketStreams.h" -#include "networktables2/stream/SocketStreamFactory.h" -#include "networktables2/stream/SocketServerStreamProvider.h" - - - -IOStreamFactory& SocketStreams::newStreamFactory(const char* host, int port){ - return *new SocketStreamFactory(host, port); -} - -IOStreamProvider& SocketStreams::newStreamProvider(int port){ - return *new SocketServerStreamProvider(port); -} - diff --git a/networktables/cpp/Azalea/src/main/native/networktables2/thread/DefaultThreadManger.cpp b/networktables/cpp/Azalea/src/main/native/networktables2/thread/DefaultThreadManger.cpp deleted file mode 100644 index ebc5edf185..0000000000 --- a/networktables/cpp/Azalea/src/main/native/networktables2/thread/DefaultThreadManger.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * DefaultThreadManger.cpp - * - * Created on: Sep 21, 2012 - * Author: Mitchell Wills - */ - -#include "networktables2/thread/DefaultThreadManager.h" -#include - - -PeriodicNTThread::PeriodicNTThread(PeriodicRunnable* _r, const char* _name) : - name(_name), thread(new NTTask(name, (FUNCPTR)PeriodicNTThread::taskMain)), r(_r), run(true){ - fprintf(stdout, "Starting task: %s\n", name); - fflush(stdout); - thread->Start((UINT32)this); -} - -PeriodicNTThread::~PeriodicNTThread(){ - //TODO somehow do this async - //delete thread; -} -int PeriodicNTThread::taskMain(PeriodicNTThread* o){//static wrapper - return o->_taskMain(); -} -int PeriodicNTThread::_taskMain(){ - try { - while(run){ - r->run(); - } - } catch (...) { - fprintf(stdout, "NTTask exited with uncaught exception %s\n", name); - fflush(stdout); - return 1; - } - fprintf(stdout, "NTTask exited normally: %s\n", name); - fflush(stdout); - return 0; -} -void PeriodicNTThread::stop() { - run = false; -} -bool PeriodicNTThread::isRunning() { - return thread->IsReady(); -} - -NTThread* DefaultThreadManager::newBlockingPeriodicThread(PeriodicRunnable* r, const char* name) { - return new PeriodicNTThread(r, name); -} diff --git a/networktables/cpp/Azalea/src/main/native/networktables2/util/System.cpp b/networktables/cpp/Azalea/src/main/native/networktables2/util/System.cpp deleted file mode 100644 index 30b3c9086a..0000000000 --- a/networktables/cpp/Azalea/src/main/native/networktables2/util/System.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* - * System.cpp - * - * Created on: Sep 26, 2012 - * Author: Mitchell Wills - */ - -#include "networktables2/util/System.h" -#include "semLib.h" -#include -#include // for sysClkRateGet -#include // for taskDelay - -void sleep_ms(unsigned long ms){ - taskDelay((INT32)((double)sysClkRateGet() * ms / 1000)); -} -unsigned long currentTimeMillis(){ - struct timespec tp; - clock_gettime(CLOCK_REALTIME,&tp); - return tp.tv_sec*1000 + tp.tv_nsec/1000; -} -void writeWarning(const char* message){ - fprintf(stderr, "%s\n", message); - fflush(stderr); - //TODO implement write warning with wpilib error stuff -} diff --git a/networktables/cpp/parent/pom.xml b/networktables/cpp/parent/pom.xml index d4687bd51b..9a5f0a59da 100644 --- a/networktables/cpp/parent/pom.xml +++ b/networktables/cpp/parent/pom.xml @@ -37,18 +37,4 @@ - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - diff --git a/networktables/cpp/pom.xml b/networktables/cpp/pom.xml index 238bf5ca4d..67e984f58e 100644 --- a/networktables/cpp/pom.xml +++ b/networktables/cpp/pom.xml @@ -9,21 +9,10 @@ include + Athena - - - - - jenkins - - - myrepository - file:${local-repository} - - - desktop @@ -34,23 +23,5 @@ Desktop - - athena - - true - - - Athena - - - - azalea - - false - - - Azalea - - diff --git a/networktables/java/Athena/pom.xml b/networktables/java/Athena/pom.xml index 9d8a05cc90..f64ad240cb 100644 --- a/networktables/java/Athena/pom.xml +++ b/networktables/java/Athena/pom.xml @@ -1,6 +1,6 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 edu.wpi.first.wpilib.networktables.java NetworkTables @@ -14,37 +14,37 @@ - + junit junit 4.11 - test - - + test + + org.jmock jmock-junit4 2.6.0 - test - - + test + + org.jmock jmock-legacy 2.6.0 - test - + test + - - + + maven-compiler-plugin 3.1 1.6 1.6 - - edu/wpi/first/wpilibj/networktables2/system/SystemTest.java - + + edu/wpi/first/wpilibj/networktables2/system/SystemTest.java + @@ -66,14 +66,14 @@ - + org.apache.maven.plugins maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - + + + org.apache.maven.plugins + maven-javadoc-plugin + + diff --git a/networktables/java/Azalea/pom.xml b/networktables/java/Azalea/pom.xml deleted file mode 100644 index fa1c0db862..0000000000 --- a/networktables/java/Azalea/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - jar - 0.1.0-SNAPSHOT - - - edu.wpi.first.wpilib.templates.azalea - library-jar - 0.1.0-SNAPSHOT - ../../../maven-utilities/azalea/library-jar - - - - - com.sun.squawk - runtime - - - - - - - maven-compiler-plugin - 3.1 - - - edu/wpi/first/wpilibj/networktables2/system/SystemTest.java - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.8 - - - add-source - generate-sources - - add-source - - - - ../src/main/java - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionServerStreamProvider.java b/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionServerStreamProvider.java deleted file mode 100644 index 3b51e63798..0000000000 --- a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionServerStreamProvider.java +++ /dev/null @@ -1,40 +0,0 @@ -package edu.wpi.first.wpilibj.networktables2.stream; - -import java.io.*; - -import javax.microedition.io.*; - - -/** - * An object that will provide cRIO socket connections when a client connects to the server on the given port - * - * @author mwills - * - */ -public class SocketConnectionServerStreamProvider implements IOStreamProvider{ - - private final ServerSocketConnection server; - - /** - * Create a new Stream provider that wraps a Socket Server on the given port - * @param port - * @throws IOException - */ - public SocketConnectionServerStreamProvider(final int port) throws IOException{ - server = (ServerSocketConnection) Connector.open("socket://:" + port); - } - - public IOStream accept() throws IOException { - SocketConnection socket = (SocketConnection) server.acceptAndOpen(); - if(socket!=null){ - socket.setSocketOption(SocketConnection.LINGER, 0); - return new SocketConnectionStream(socket); - } - return null; - } - - public void close() throws IOException { - server.close(); - } - -} diff --git a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionStream.java b/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionStream.java deleted file mode 100644 index dbdec26ca7..0000000000 --- a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionStream.java +++ /dev/null @@ -1,64 +0,0 @@ -package edu.wpi.first.wpilibj.networktables2.stream; - -import java.io.*; - -import javax.microedition.io.*; - -/** - * A socket connection on the cRIO - * - * @author mwills - * - */ -public class SocketConnectionStream implements IOStream{ - - private final SocketConnection socket; - private final InputStream is; - private final OutputStream os; - - /** - * Create a new IOStream for a socket connection with the given host and port - * @param host - * @param port - * @throws IOException - */ - public SocketConnectionStream(final String host, final int port) throws IOException { - this((SocketConnection) Connector.open("socket://"+host+":"+port)); - } - /** - * Create a new IOStream for a socket connection - * @param socket - * @throws IOException - */ - public SocketConnectionStream(final SocketConnection socket) throws IOException { - this.socket = socket; - is = socket.openInputStream(); - os = socket.openOutputStream(); - } - - - public InputStream getInputStream() { - return is; - } - public OutputStream getOutputStream() { - return os; - } - public void close() { - try{ - is.close(); - } catch(IOException e){ - //just ignore and close the rest of the stream - } - try{ - os.close(); - } catch(IOException e){ - //just ignore and close the rest of the stream - } - try{ - socket.close(); - } catch(IOException e){ - //just ignore and assume socket is now closed - } - } - -} diff --git a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionStreamFactory.java b/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionStreamFactory.java deleted file mode 100644 index 7d1d03f6ae..0000000000 --- a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketConnectionStreamFactory.java +++ /dev/null @@ -1,30 +0,0 @@ -package edu.wpi.first.wpilibj.networktables2.stream; - -import java.io.*; - -/** - * - * @author mwills - * - */ -public class SocketConnectionStreamFactory implements IOStreamFactory{ - - private final String host; - private final int port; - - /** - * Create a new factory that will create socket connections with the given host and port - * @param host - * @param port - * @throws IOException - */ - public SocketConnectionStreamFactory(final String host, final int port) throws IOException { - this.host = host; - this.port = port; - } - - public IOStream createStream() throws IOException { - return new SocketConnectionStream(host, port); - } - -} diff --git a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketStreams.java b/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketStreams.java deleted file mode 100644 index c0627cfb78..0000000000 --- a/networktables/java/Azalea/src/main/java/edu/wpi/first/wpilibj/networktables2/stream/SocketStreams.java +++ /dev/null @@ -1,32 +0,0 @@ -package edu.wpi.first.wpilibj.networktables2.stream; - -import java.io.*; - -/** - * Static factory for socket stream factories and providers - * - * @author Mitchell - * - */ -public class SocketStreams { - /** - * Create a new IOStream factory - * @param host - * @param port - * @return a IOStreamFactory that will create Socket Connections on the given host and port - * @throws IOException - */ - public static IOStreamFactory newStreamFactory(final String host, final int port) throws IOException{ - return new SocketConnectionStreamFactory(host, port); - } - - /** - * Create a new IOStream provider - * @param port - * @return an IOStreamProvider for a socket server on the given port - * @throws IOException - */ - public static IOStreamProvider newStreamProvider(final int port) throws IOException { - return new SocketConnectionServerStreamProvider(port); - } -} diff --git a/networktables/java/Azalea/src/main/java/java/io/BufferedInputStream.java b/networktables/java/Azalea/src/main/java/java/io/BufferedInputStream.java deleted file mode 100644 index b7fdc71142..0000000000 --- a/networktables/java/Azalea/src/main/java/java/io/BufferedInputStream.java +++ /dev/null @@ -1,47 +0,0 @@ -package java.io; - -public class BufferedInputStream extends InputStream{ - private final InputStream source; - private byte[] buffer; - private int pos;//the next position to be read - private int maxPos;//the maximum valid position in the buffer + 1 - - public BufferedInputStream(InputStream source){ - this(source, 8192); - } - public BufferedInputStream(InputStream source, int size){ - this.source = source; - buffer = new byte[size]; - pos = 0; - maxPos = 0; - } - - - private void fillBuffer() throws IOException { - int numRemaining = maxPos-pos; - System.arraycopy(buffer, pos, buffer, 0, numRemaining); - pos = 0; - maxPos = numRemaining; - int numRead = source.read(buffer, numRemaining, buffer.length-numRemaining); - maxPos += numRead; - } - - public int read() throws IOException { - if(pos0){ - out.write(buffer, 0, pos); - pos = 0; - } - } - - public void write(int b) throws IOException { - buffer[pos++] = (byte)b; - if(pos>=buffer.length) - flushBuffer(); - } - - public void write(byte b[], int off, int len) throws IOException { - if(len>=buffer.length){ - flushBuffer(); - out.write(b, off, len); - } - else{ - if(len>=(buffer.length-pos)) - flushBuffer(); - - System.arraycopy(b, off, buffer, pos, len); - pos += len; - } - } - - public void flush() throws IOException{ - flushBuffer(); - out.flush(); - } - - public void close() throws IOException{ - flushBuffer(); - out.close(); - } - -} diff --git a/networktables/java/Azalea/src/test/java/edu/wpi/first/wpilibj/networktables2/system/SystemTest.java b/networktables/java/Azalea/src/test/java/edu/wpi/first/wpilibj/networktables2/system/SystemTest.java deleted file mode 100644 index 2e3799033b..0000000000 --- a/networktables/java/Azalea/src/test/java/edu/wpi/first/wpilibj/networktables2/system/SystemTest.java +++ /dev/null @@ -1,115 +0,0 @@ -package edu.wpi.first.wpilibj.networktables2.system; - -import edu.wpi.first.testing.*; -import edu.wpi.first.wpilibj.networktables2.server.*; -import edu.wpi.first.wpilibj.networktables2.stream.*; -import edu.wpi.first.wpilibj.tables.ITable; -import edu.wpi.first.wpilibj.tables.ITableListener; -import java.io.*; - -public class SystemTest extends TestClass { - private static NetworkTableServer staticServer; - static{ - try { - staticServer = new NetworkTableServer(SocketStreams.newStreamProvider(1735)); - } catch (IOException ex) { - ex.printStackTrace(); - } - } - NetworkTableServer server; - public void before() throws IOException{ - server = staticServer; - staticServer.getEntryStore().clearEntries(); - } - public void after(){ - //server.close(); - } - - public void testSimpleBidirectionalPut() throws Exception{ - sendMessage("server up"); - - waitMessage();//Client connected - System.out.println("client sent"); - sleep(100); - assertEquals("CValue1-1", server.getString("ClientString1")); - assertEquals("CValue2-1", server.getString("ClientString2")); - server.putString("ServerString1", "SValue1-1"); - server.putString("ServerString2", "SValue2-1"); - sendMessage("server sent"); - System.out.println("sent server"); - - waitMessage();//Client sent - System.out.println("client sent"); - sleep(100); - assertEquals("CValue1-2", server.getString("ClientString1")); - assertEquals("CValue2-2", server.getString("ClientString2")); - server.putString("ServerString1", "SValue1-2"); - server.putString("ServerString2", "SValue2-2"); - sendMessage("server sent"); - System.out.println("sent server"); - - waitMessage();//test complete - } - public void testRapidServerPutSingleKey() throws Exception{ - sendMessage("server up"); - - waitMessage();//Client connected - - - for(int i = 0; i<10000; ++i) - server.putString("ServerKey", "SValue"+i); - - sleep(100); - sendMessage("server done"); - - waitMessage();//test complete - } - public void testRapidServerPutMultiKey() throws Exception{ - sendMessage("server up"); - - waitMessage();//Client connected - - - for(int i = 0; i<1000; ++i) - for(int j = 0; j<100; ++j) - server.putString("ServerKey"+j, "SValue"+i); - - sleep(100); - sendMessage("server done"); - - waitMessage();//test complete - } - public void testPeriodicServerPutMultiKey() throws Exception{ - sendMessage("server up"); - - waitMessage();//Client connected - - - for(int i = 0; i<100; ++i){ - for(int j = 0; j<100; ++j) - server.putString("ServerKey"+j, "SValue"+i); - sleep(20); - } - sleep(100); - - sendMessage("server done"); - - waitMessage();//test complete - } - public void testBiDirectionalStress() throws Exception{ - server.addTableListener(new ITableListener() { - - public void valueChanged(ITable source, String key, Object value, boolean isNew) { - int prefixIndex = key.indexOf("/client/"); - if(prefixIndex == 0) { - String name = key.substring("/client/".length()); - server.putDouble("/server/" + name, ((Double) value).doubleValue()); - } - } - }, false); - sendMessage("Server ready"); - waitMessage(); // Client connected - - waitMessage(); // Client done - } -} diff --git a/networktables/java/ant/crio.xml b/networktables/java/ant/crio.xml deleted file mode 100644 index c61186b086..0000000000 --- a/networktables/java/ant/crio.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/networktables/java/ant/desktop.xml b/networktables/java/ant/desktop.xml deleted file mode 100644 index a2248cc22d..0000000000 --- a/networktables/java/ant/desktop.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/networktables/java/ant/javadoc.xml b/networktables/java/ant/javadoc.xml deleted file mode 100644 index 139bc4b832..0000000000 --- a/networktables/java/ant/javadoc.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - Network Tables 2.0 - ]]> - - - - - \ No newline at end of file diff --git a/networktables/java/ant/test.xml b/networktables/java/ant/test.xml deleted file mode 100644 index ffd251db56..0000000000 --- a/networktables/java/ant/test.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/networktables/java/build.xml b/networktables/java/build.xml deleted file mode 100644 index 5092dbc37f..0000000000 --- a/networktables/java/build.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Building NetworkTables 2.0 - Build Number: ${BUILD_NUMBER} - Build Time: ${BUILD_ID} - SVN Revision: ${SVN_REVISION} - Build Type: ${BUILD_TYPE} - - - - - - - - - - - - diff --git a/networktables/java/dist-old/pom.xml b/networktables/java/dist-old/pom.xml deleted file mode 100644 index f70c9d4436..0000000000 --- a/networktables/java/dist-old/pom.xml +++ /dev/null @@ -1,167 +0,0 @@ - - - - - 4.0.0 - edu.wpi.first.wpilib.networktables.java - dist-old - pom - 0.1.0-SNAPSHOT - - - - - org.apache.maven.plugins - maven-dependency-plugin - 2.8 - - - - - fetch-sunspotfrcsdk-dependencies - compile - - copy - - - - - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - 0.1.0-SNAPSHOT - jar - networktables-crio.jar - ${project.build.directory}/dist/lib - - - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - 0.1.0-SNAPSHOT - javadoc - networktables-crio-javadoc.jar - ${project.build.directory}/dist/lib - - - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - 0.1.0-SNAPSHOT - sources - networktables-crio-sources.jar - ${project.build.directory}/dist/lib - - - edu.wpi.first.wpilib.networktables.java - NetworkTables - 0.1.0-SNAPSHOT - jar - networktables-desktop.jar - ${project.build.directory}/dist/desktop-lib - - - edu.wpi.first.wpilib.networktables.java - NetworkTables - 0.1.0-SNAPSHOT - javadoc - networktables-desktop-javadoc.jar - ${project.build.directory}/dist/desktop-lib - - - edu.wpi.first.wpilib.networktables.java - NetworkTables - 0.1.0-SNAPSHOT - sources - networktables-desktop-sources.jar - ${project.build.directory}/dist/desktop-lib - - - false - true - - - - - - - - - - junit - junit - 4.11 - test - - - org.jmock - jmock-junit4 - 2.6.0 - test - - - org.jmock - jmock-legacy - 2.6.0 - test - - - - - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - 0.1.0-SNAPSHOT - jar - - - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - 0.1.0-SNAPSHOT - javadoc - - - edu.wpi.first.wpilib.networktables.java - NetworkTablesAzalea - 0.1.0-SNAPSHOT - sources - - - edu.wpi.first.wpilib.networktables.java - NetworkTables - 0.1.0-SNAPSHOT - jar - - - edu.wpi.first.wpilib.networktables.java - NetworkTables - 0.1.0-SNAPSHOT - javadoc - - - edu.wpi.first.wpilib.networktables.java - NetworkTables - 0.1.0-SNAPSHOT - sources - - - - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - - diff --git a/networktables/java/lib/jacocoant.jar b/networktables/java/lib/jacocoant.jar deleted file mode 100644 index 44ecc8238e..0000000000 Binary files a/networktables/java/lib/jacocoant.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/bsh-core-2.0b4.jar b/networktables/java/lib/jmock/bsh-core-2.0b4.jar deleted file mode 100644 index a1b8e47288..0000000000 Binary files a/networktables/java/lib/jmock/bsh-core-2.0b4.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/cglib-nodep-2.2.jar b/networktables/java/lib/jmock/cglib-nodep-2.2.jar deleted file mode 100644 index ed07cb507f..0000000000 Binary files a/networktables/java/lib/jmock/cglib-nodep-2.2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/cglib-src-2.2.jar b/networktables/java/lib/jmock/cglib-src-2.2.jar deleted file mode 100644 index 4a32ba9861..0000000000 Binary files a/networktables/java/lib/jmock/cglib-src-2.2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/hamcrest-core-1.3.0RC1.jar b/networktables/java/lib/jmock/hamcrest-core-1.3.0RC1.jar deleted file mode 100644 index 1195cb7f58..0000000000 Binary files a/networktables/java/lib/jmock/hamcrest-core-1.3.0RC1.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/hamcrest-library-1.3.0RC1.jar b/networktables/java/lib/jmock/hamcrest-library-1.3.0RC1.jar deleted file mode 100644 index 8e6568b550..0000000000 Binary files a/networktables/java/lib/jmock/hamcrest-library-1.3.0RC1.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/hamcrest-unit-test-1.3.0RC1.jar b/networktables/java/lib/jmock/hamcrest-unit-test-1.3.0RC1.jar deleted file mode 100644 index 8ff006377c..0000000000 Binary files a/networktables/java/lib/jmock/hamcrest-unit-test-1.3.0RC1.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/jmock-2.6.0-RC2.jar b/networktables/java/lib/jmock/jmock-2.6.0-RC2.jar deleted file mode 100644 index a846450ff1..0000000000 Binary files a/networktables/java/lib/jmock/jmock-2.6.0-RC2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/jmock-junit3-2.6.0-RC2.jar b/networktables/java/lib/jmock/jmock-junit3-2.6.0-RC2.jar deleted file mode 100644 index f7608b54b8..0000000000 Binary files a/networktables/java/lib/jmock/jmock-junit3-2.6.0-RC2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/jmock-junit4-2.6.0-RC2.jar b/networktables/java/lib/jmock/jmock-junit4-2.6.0-RC2.jar deleted file mode 100644 index 129e561360..0000000000 Binary files a/networktables/java/lib/jmock/jmock-junit4-2.6.0-RC2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/jmock-legacy-2.6.0-RC2.jar b/networktables/java/lib/jmock/jmock-legacy-2.6.0-RC2.jar deleted file mode 100644 index d35c8f317f..0000000000 Binary files a/networktables/java/lib/jmock/jmock-legacy-2.6.0-RC2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/jmock-script-2.6.0-RC2.jar b/networktables/java/lib/jmock/jmock-script-2.6.0-RC2.jar deleted file mode 100644 index f2d4043413..0000000000 Binary files a/networktables/java/lib/jmock/jmock-script-2.6.0-RC2.jar and /dev/null differ diff --git a/networktables/java/lib/jmock/objenesis-1.0.jar b/networktables/java/lib/jmock/objenesis-1.0.jar deleted file mode 100644 index 3a78df04ee..0000000000 Binary files a/networktables/java/lib/jmock/objenesis-1.0.jar and /dev/null differ diff --git a/networktables/java/lib/junit-dep-4.10.jar b/networktables/java/lib/junit-dep-4.10.jar deleted file mode 100644 index 9b88183e8a..0000000000 Binary files a/networktables/java/lib/junit-dep-4.10.jar and /dev/null differ diff --git a/networktables/java/pom.xml b/networktables/java/pom.xml index 7f4b2a51ce..3258f857af 100644 --- a/networktables/java/pom.xml +++ b/networktables/java/pom.xml @@ -1,52 +1,25 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 edu.wpi.first.wpilib.networktables java pom 0.1.0-SNAPSHOT - - - + + Athena + + - - jenkins - - - myrepository - file:${local-repository} - - - - - desktop + + desktop - true + true - - Athena - - - - athena - - true - - - Athena - - - - azalea - - false - - - Azalea - dist-old - - + + Athena + + diff --git a/networktables/pom.xml b/networktables/pom.xml index 3313f9b407..79fadb3983 100644 --- a/networktables/pom.xml +++ b/networktables/pom.xml @@ -11,19 +11,4 @@ cpp java - - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - diff --git a/ni-libraries/libFRC_FPGA_ChipObject/libFRC_FPGA_ChipObject.so b/ni-libraries/libFRC_FPGA_ChipObject/libFRC_FPGA_ChipObject.so index 0663acb620..fe5260f9e4 100644 Binary files a/ni-libraries/libFRC_FPGA_ChipObject/libFRC_FPGA_ChipObject.so and b/ni-libraries/libFRC_FPGA_ChipObject/libFRC_FPGA_ChipObject.so differ diff --git a/ni-libraries/libFRC_NetworkCommunication/libFRC_NetworkCommunication.so b/ni-libraries/libFRC_NetworkCommunication/libFRC_NetworkCommunication.so index 07bd4b1e3e..bb8dc8a0a3 100644 Binary files a/ni-libraries/libFRC_NetworkCommunication/libFRC_NetworkCommunication.so and b/ni-libraries/libFRC_NetworkCommunication/libFRC_NetworkCommunication.so differ diff --git a/ni-libraries/libNiFpga/libNiFpga.so b/ni-libraries/libNiFpga/libNiFpga.so index 5b9d2fb1f1..008606aef9 100644 Binary files a/ni-libraries/libNiFpga/libNiFpga.so and b/ni-libraries/libNiFpga/libNiFpga.so differ diff --git a/ni-libraries/libNiFpgaLv/libNiFpgaLv.so b/ni-libraries/libNiFpgaLv/libNiFpgaLv.so index 8bb07cece9..4069f91122 100644 Binary files a/ni-libraries/libNiFpgaLv/libNiFpgaLv.so and b/ni-libraries/libNiFpgaLv/libNiFpgaLv.so differ diff --git a/ni-libraries/libNiRioSrv/libNiRioSrv.so b/ni-libraries/libNiRioSrv/libNiRioSrv.so index 17aec6e4e7..9ca867a2b7 100644 Binary files a/ni-libraries/libNiRioSrv/libNiRioSrv.so and b/ni-libraries/libNiRioSrv/libNiRioSrv.so differ diff --git a/ni-libraries/libRoboRIO_FRC_ChipObject/libRoboRIO_FRC_ChipObject.so b/ni-libraries/libRoboRIO_FRC_ChipObject/libRoboRIO_FRC_ChipObject.so index 1dc17e407f..cf57cca526 100644 Binary files a/ni-libraries/libRoboRIO_FRC_ChipObject/libRoboRIO_FRC_ChipObject.so and b/ni-libraries/libRoboRIO_FRC_ChipObject/libRoboRIO_FRC_ChipObject.so differ diff --git a/ni-libraries/libfrccansae/libfrccansae.so b/ni-libraries/libfrccansae/libfrccansae.so new file mode 100644 index 0000000000..7de8dc3885 Binary files /dev/null and b/ni-libraries/libfrccansae/libfrccansae.so differ diff --git a/ni-libraries/libfrccansae/pom.xml b/ni-libraries/libfrccansae/pom.xml new file mode 100644 index 0000000000..4a3d847c38 --- /dev/null +++ b/ni-libraries/libfrccansae/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + libfrccansae + so + + + com.ni.first.libraries + parent + 0.1.0-SNAPSHOT + ../parent + + + + libfrccansae.so + + diff --git a/ni-libraries/libi2c/libi2c.so b/ni-libraries/libi2c/libi2c.so new file mode 100644 index 0000000000..f59b7ea1fc Binary files /dev/null and b/ni-libraries/libi2c/libi2c.so differ diff --git a/ni-libraries/libi2c/pom.xml b/ni-libraries/libi2c/pom.xml new file mode 100644 index 0000000000..d74a5b91de --- /dev/null +++ b/ni-libraries/libi2c/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + libi2c + so + + + com.ni.first.libraries + parent + 0.1.0-SNAPSHOT + ../parent + + + + libi2c.so + + diff --git a/ni-libraries/libni_emb/libni_emb.so b/ni-libraries/libni_emb/libni_emb.so index 8271f58fb4..f0b10fd3d5 100644 Binary files a/ni-libraries/libni_emb/libni_emb.so and b/ni-libraries/libni_emb/libni_emb.so differ diff --git a/ni-libraries/libni_rtlog/libni_rtlog.so b/ni-libraries/libni_rtlog/libni_rtlog.so index cbb72d9b48..02d86cf005 100644 Binary files a/ni-libraries/libni_rtlog/libni_rtlog.so and b/ni-libraries/libni_rtlog/libni_rtlog.so differ diff --git a/ni-libraries/libnirio_emb_can/libnirio_emb_can.so b/ni-libraries/libnirio_emb_can/libnirio_emb_can.so index d71cbec3cc..6e97425b4c 100644 Binary files a/ni-libraries/libnirio_emb_can/libnirio_emb_can.so and b/ni-libraries/libnirio_emb_can/libnirio_emb_can.so differ diff --git a/ni-libraries/libspi/libspi.so b/ni-libraries/libspi/libspi.so new file mode 100644 index 0000000000..207ea3b761 Binary files /dev/null and b/ni-libraries/libspi/libspi.so differ diff --git a/ni-libraries/libspi/pom.xml b/ni-libraries/libspi/pom.xml new file mode 100644 index 0000000000..d362cdedf1 --- /dev/null +++ b/ni-libraries/libspi/pom.xml @@ -0,0 +1,18 @@ + + + 4.0.0 + libspi + so + + + com.ni.first.libraries + parent + 0.1.0-SNAPSHOT + ../parent + + + + libspi.so + + diff --git a/ni-libraries/parent/pom.xml b/ni-libraries/parent/pom.xml index 8087b04e89..63b7f9869a 100644 --- a/ni-libraries/parent/pom.xml +++ b/ni-libraries/parent/pom.xml @@ -10,7 +10,6 @@ UTF-8 UTF-8 - @@ -34,15 +33,6 @@ - - jenkins - - - myrepository - file:${local-repository} - - - windows-builder diff --git a/ni-libraries/pom.xml b/ni-libraries/pom.xml index 05942735c2..69c08da92b 100644 --- a/ni-libraries/pom.xml +++ b/ni-libraries/pom.xml @@ -11,27 +11,15 @@ parent libFRC_NetworkCommunication libRoboRIO_FRC_ChipObject - libFRC_FPGA_ChipObject + libFRC_FPGA_ChipObject libNiFpga libni_emb libNiFpgaLv libNiRioSrv libni_rtlog libnirio_emb_can + libfrccansae + libi2c + libspi - - - - - - - jenkins - - - myrepository - file:${local-repository} - - - - diff --git a/wpilibc/Azalea/pom.xml b/wpilibc/Azalea/pom.xml deleted file mode 100644 index ed122171ea..0000000000 --- a/wpilibc/Azalea/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - 4.0.0 - edu.wpi.first.wpilib.cpp - libWPILibAzalea - a - - - edu.wpi.first.wpilib.templates.azalea - static-library - 0.1.0-SNAPSHOT - ../../maven-utilities/Azalea/static-library/pom.xml - - - - - edu.wpi.first.wpilib.hal - include - 0.1.0-SNAPSHOT - inczip - - - edu.wpi.first.wpilib.networktables.cpp - include - 0.1.0-SNAPSHOT - inczip - - - - - - - org.codehaus.mojo - native-maven-plugin - - - - ../src/main/native - - **/*.cpp - - - Vision/* - - - - ../src/main/include - - - true - - - - - - - diff --git a/wpilibc/jna/pom.xml b/wpilibc/jna/pom.xml deleted file mode 100644 index b4e754ac0e..0000000000 --- a/wpilibc/jna/pom.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - 4.0.0 - JNAWrappers - edu.wpi.first.wpilibj - 0.1.0-SNAPSHOT - pom - - - - com.nativelibs4java - jnaerator-runtime - 0.12-SNAPSHOT - compile - - - - - - sonatype - Sonatype OSS Snapshots Repository - http://oss.sonatype.org/content/groups/public - - - - nativelibs4java-repo - http://nativelibs4java.sourceforge.net/maven - - - - - sonatype - Sonatype OSS Snapshots Repository - http://oss.sonatype.org/content/groups/public - - - - nativelibs4java-repo - http://nativelibs4java.sourceforge.net/maven - - - - - - - com.nativelibs4java - maven-jnaerator-plugin - 0.12-SNAPSHOT - true - - - network-communications - process-classes - - generate - - - src/main/jnaerator/networkcommunications.jnaerator - - - - can - process-classes - - generate - - - src/main/jnaerator/can.jnaerator - - - - - - - diff --git a/wpilibc/jna/src/main/jnaerator/can.jnaerator b/wpilibc/jna/src/main/jnaerator/can.jnaerator deleted file mode 100644 index 5503483ea7..0000000000 --- a/wpilibc/jna/src/main/jnaerator/can.jnaerator +++ /dev/null @@ -1,11 +0,0 @@ --dontCastConstants --runtime JNAerator --direct --M__java=true - --package edu.wpi.first.wpilibj.can - --library CAN - -../src/main/include/CAN/JaguarCANDriver.h -../src/main/include/CAN/can_proto.h \ No newline at end of file diff --git a/wpilibc/jna/src/main/jnaerator/networkcommunications.jnaerator b/wpilibc/jna/src/main/jnaerator/networkcommunications.jnaerator deleted file mode 100644 index c51684a915..0000000000 --- a/wpilibc/jna/src/main/jnaerator/networkcommunications.jnaerator +++ /dev/null @@ -1,15 +0,0 @@ --dontCastConstants --runtime JNAerator --direct --M__java=true - --package edu.wpi.first.wpilibj.communication - --library FRC_NetworkCommunications - -../src/main/include/NetworkCommunication/AICalibration.h -../src/main/include/NetworkCommunication/LoadOut.h -../src/main/include/NetworkCommunication/symModuleLink.h -../src/main/include/NetworkCommunication/UsageReporting.h -../src/main/include/NetworkCommunication/FRCComm.h - diff --git a/wpilibc/pom.xml b/wpilibc/pom.xml index 771e232154..a4c9c42287 100644 --- a/wpilibc/pom.xml +++ b/wpilibc/pom.xml @@ -6,34 +6,8 @@ cpp pom 0.1.0-SNAPSHOT - - - - jenkins - - - myrepository - file:${local-repository} - - - - - athena - - true - - - Athena - - - - azalea - - false - - - Azalea - - - + + + Athena + diff --git a/wpilibc/src/main/include/RobotBase.h b/wpilibc/src/main/include/RobotBase.h index ff181a2270..6d5e4eb21b 100644 --- a/wpilibc/src/main/include/RobotBase.h +++ b/wpilibc/src/main/include/RobotBase.h @@ -9,7 +9,6 @@ #include "Base.h" #include "Task.h" -#include "Watchdog.h" class DriverStation; @@ -59,9 +58,7 @@ public: bool IsAutonomous(); bool IsOperatorControl(); bool IsTest(); - bool IsSystemActive(); bool IsNewDataAvailable(); - Watchdog &GetWatchdog(); static void startRobotTask(FUNCPTR factory); static void robotTask(FUNCPTR factory, Task *task); virtual void StartCompetition() = 0; @@ -71,7 +68,6 @@ protected: RobotBase(); Task *m_task; - Watchdog m_watchdog; DriverStation *m_ds; private: diff --git a/wpilibc/src/main/include/WPILib.h b/wpilibc/src/main/include/WPILib.h index ed468cd5f5..4b5c57171a 100644 --- a/wpilibc/src/main/include/WPILib.h +++ b/wpilibc/src/main/include/WPILib.h @@ -86,7 +86,6 @@ #include "Utility.h" #include "Victor.h" // XXX: #include "Vision/AxisCamera.h" -#include "Watchdog.h" #include "WPIErrors.h" #endif /*WPILIB_H_*/ diff --git a/wpilibc/src/main/include/Watchdog.h b/wpilibc/src/main/include/Watchdog.h deleted file mode 100644 index 79f3dee976..0000000000 --- a/wpilibc/src/main/include/Watchdog.h +++ /dev/null @@ -1,45 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#ifndef WATCHDOG_H -#define WATCHDOG_H - -#include "HAL/HAL.h" -#include "SensorBase.h" -#include "Base.h" - -/** - * Watchdog timer class. - * The watchdog timer is designed to keep the robots safe. The idea is that the robot program must - * constantly "feed" the watchdog otherwise it will shut down all the motor outputs. That way if a - * program breaks, rather than having the robot continue to operate at the last known speed, the - * motors will be shut down. - * - * This is serious business. Don't just disable the watchdog. You can't afford it! - * - * http://thedailywtf.com/Articles/_0x2f__0x2f_TODO_0x3a__Uncomment_Later.aspx - */ -class Watchdog : public SensorBase -{ -public: - Watchdog(); - virtual ~Watchdog(); - bool Feed(); - void Kill(); - double GetTimer(); - double GetExpiration(); - void SetExpiration(double expiration); - bool GetEnabled(); - void SetEnabled(bool enabled); - bool IsAlive(); - bool IsSystemActive(); - -private: - void* m_watchdog; - DISALLOW_COPY_AND_ASSIGN(Watchdog); -}; - -#endif diff --git a/wpilibc/src/main/native/IterativeRobot.cpp b/wpilibc/src/main/native/IterativeRobot.cpp index aa89add7f2..e5a340cfcd 100644 --- a/wpilibc/src/main/native/IterativeRobot.cpp +++ b/wpilibc/src/main/native/IterativeRobot.cpp @@ -28,7 +28,6 @@ IterativeRobot::IterativeRobot() , m_testInitialized (false) , m_period (kDefaultPeriod) { - m_watchdog.SetEnabled(false); } /** diff --git a/wpilibc/src/main/native/RobotBase.cpp b/wpilibc/src/main/native/RobotBase.cpp index f3f3eaeeb4..df3ae98d20 100644 --- a/wpilibc/src/main/native/RobotBase.cpp +++ b/wpilibc/src/main/native/RobotBase.cpp @@ -62,26 +62,6 @@ RobotBase::~RobotBase() m_instance = NULL; } -/** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ -bool RobotBase::IsSystemActive() -{ - return m_watchdog.IsSystemActive(); -} - -/** - * Return the instance of the Watchdog timer. - * Get the watchdog timer so the user program can either disable it or feed it when - * necessary. - */ -Watchdog &RobotBase::GetWatchdog() -{ - return m_watchdog; -} - /** * Determine if the Robot is currently enabled. * @return True if the Robot is currently enabled by the field controls. diff --git a/wpilibc/src/main/native/SimpleRobot.cpp b/wpilibc/src/main/native/SimpleRobot.cpp index 5b0ff4a8dd..09f59d6b71 100644 --- a/wpilibc/src/main/native/SimpleRobot.cpp +++ b/wpilibc/src/main/native/SimpleRobot.cpp @@ -16,7 +16,6 @@ SimpleRobot::SimpleRobot() : m_robotMainOverridden (true) { - m_watchdog.SetEnabled(false); } /** diff --git a/wpilibc/src/main/native/Watchdog.cpp b/wpilibc/src/main/native/Watchdog.cpp deleted file mode 100644 index 800e36772f..0000000000 --- a/wpilibc/src/main/native/Watchdog.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ -/*----------------------------------------------------------------------------*/ - -#include "Watchdog.h" - -/** - * The Watchdog is born. - */ -Watchdog::Watchdog() - : m_watchdog(NULL) -{ - int32_t status = 0; - m_watchdog = initializeWatchdog(&status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); -} - -/** - * Time to bury him in the back yard. - */ -Watchdog::~Watchdog() -{ - int32_t status = 0; - cleanWatchdog(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - m_watchdog = NULL; -} - -/** - * Throw the dog a bone. - * - * When everything is going well, you feed your dog when you get home. - * Let's hope you don't drive your car off a bridge on the way home... - * Your dog won't get fed and he will starve to death. - * - * By the way, it's not cool to ask the neighbor (some random task) to - * feed your dog for you. He's your responsibility! - * - * @returns Returns the previous state of the watchdog before feeding it. - */ -bool Watchdog::Feed() -{ - int32_t status = 0; - bool previous = feedWatchdog(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - return previous; -} - -/** - * Put the watchdog out of its misery. - * - * Don't wait for your dying robot to starve when there is a problem. - * Kill it quickly, cleanly, and humanely. - */ -void Watchdog::Kill() -{ - int32_t status = 0; - killWatchdog(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); -} - -/** - * Read how long it has been since the watchdog was last fed. - * - * @return The number of seconds since last meal. - */ -double Watchdog::GetTimer() -{ - int32_t status = 0; - double timer = getWatchdogLastFed(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - return timer; -} - -/** - * Read what the current expiration is. - * - * @return The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -double Watchdog::GetExpiration() -{ - int32_t status = 0; - bool expiration = getWatchdogExpiration(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - return expiration; -} - -/** - * Configure how many seconds your watchdog can be neglected before it starves to death. - * - * @param expiration The number of seconds before starvation following a meal (watchdog starves if it doesn't eat this often). - */ -void Watchdog::SetExpiration(double expiration) -{ - int32_t status = 0; - setWatchdogExpiration(m_watchdog, expiration, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); -} - -/** - * Find out if the watchdog is currently enabled or disabled (mortal or immortal). - * - * @return Enabled or disabled. - */ -bool Watchdog::GetEnabled() -{ - int32_t status = 0; - bool enabled = getWatchdogEnabled(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - return enabled; -} - -/** - * Enable or disable the watchdog timer. - * - * When enabled, you must keep feeding the watchdog timer to - * keep the watchdog active, and hence the dangerous parts - * (motor outputs, etc.) can keep functioning. - * When disabled, the watchdog is immortal and will remain active - * even without being fed. It will also ignore any kill commands - * while disabled. - * - * @param enabled Enable or disable the watchdog. - */ -void Watchdog::SetEnabled(bool enabled) -{ - int32_t status = 0; - setWatchdogEnabled(m_watchdog, enabled, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); -} - -/** - * Check in on the watchdog and make sure he's still kicking. - * - * This indicates that your watchdog is allowing the system to operate. - * It is still possible that the network communications is not allowing the - * system to run, but you can check this to make sure it's not your fault. - * Check IsSystemActive() for overall system status. - * - * If the watchdog is disabled, then your watchdog is immortal. - * - * @return Is the watchdog still alive? - */ -bool Watchdog::IsAlive() -{ - int32_t status = 0; - bool alive = isWatchdogAlive(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - return alive; -} - -/** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ -bool Watchdog::IsSystemActive() -{ - int32_t status = 0; - bool alive = isWatchdogSystemActive(m_watchdog, &status); - wpi_setErrorWithContext(status, getHALErrorMessage(status)); - return alive; -} - diff --git a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java b/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java index 7fec084625..96c751d8cd 100644 --- a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java +++ b/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/IterativeRobot.java @@ -129,7 +129,6 @@ public class IterativeRobot extends RobotBase { m_disabledInitialized = false; } if (nextPeriodReady()) { - getWatchdog().feed(); FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationObserveUserProgramAutonomous(); autonomousPeriodic(); didAutonomousPeriodic = true; @@ -146,7 +145,6 @@ public class IterativeRobot extends RobotBase { m_disabledInitialized = false; } if (nextPeriodReady()) { - getWatchdog().feed(); FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationObserveUserProgramTeleop(); teleopPeriodic(); didTeleopPeriodic = true; diff --git a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/RobotBase.java b/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/RobotBase.java index 91c5bb3b0d..b66f552c5b 100644 --- a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/RobotBase.java +++ b/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/RobotBase.java @@ -41,7 +41,6 @@ public abstract class RobotBase { public final static String ERRORS_TO_DRIVERSTATION_PROP = "first.driverstation.senderrors"; protected final DriverStation m_ds; - private final Watchdog m_watchdog = Watchdog.getInstance(); /** * Constructor for a generic robot program. @@ -61,7 +60,6 @@ public abstract class RobotBase { // } NetworkTable.setServerMode();//must be before b m_ds = DriverStation.getInstance(); - m_watchdog.setEnabled(false); NetworkTable.getTable(""); // forces network tables to initialize NetworkTable.getTable("LiveWindow").getSubTable("~STATUS~").putBoolean("LW Enabled", false); } @@ -72,26 +70,6 @@ public abstract class RobotBase { public void free() { } - /** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ - public boolean isSystemActive() { - return m_watchdog.isSystemActive(); - } - - /** - * Return the instance of the Watchdog timer. - * Get the watchdog timer so the user program can either disable it or feed it when - * necessary. - * - * @return The Watchdog timer. - */ - public Watchdog getWatchdog() { - return m_watchdog; - } - /** * Determine if the Robot is currently disabled. * @return True if the Robot is currently disabled by the field controls. @@ -167,107 +145,100 @@ public abstract class RobotBase { public static void main(String args[]) { // TODO: expose main to teams?{ boolean errorOnExit = false; - /* JNI Testing */ - boolean booleanTest = true; - byte byteTest = (byte)0xa5; - char charTest = 'X'; - short shortTest = 12346; - int intTest = 2987654; - long longTest = 897678665; - float floatTest = 45.123456f; - double doubleTest = 234E16; + // /* JNI Testing */ + // boolean booleanTest = true; + // byte byteTest = (byte)0xa5; + // char charTest = 'X'; + // short shortTest = 12346; + // int intTest = 2987654; + // long longTest = 897678665; + // float floatTest = 45.123456f; + // double doubleTest = 234E16; - FRCNetworkCommunicationsLibrary.JNIValueParameterTest(booleanTest, byteTest, charTest, shortTest, - intTest, longTest, floatTest, doubleTest); + // FRCNetworkCommunicationsLibrary.JNIValueParameterTest(booleanTest, byteTest, charTest, shortTest, + // intTest, longTest, floatTest, doubleTest); - boolean booleanReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnBooleanTest(booleanTest); - System.out.println("Boolean Return: " + booleanReturn ); + // boolean booleanReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnBooleanTest(booleanTest); + // System.out.println("Boolean Return: " + booleanReturn ); - byte byteReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnByteTest(byteTest); - System.out.println("Byte Return: " + byteReturn ); + // byte byteReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnByteTest(byteTest); + // System.out.println("Byte Return: " + byteReturn ); - char charReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnCharTest(charTest); - System.out.println("Char Return: " + charReturn ); + // char charReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnCharTest(charTest); + // System.out.println("Char Return: " + charReturn ); - short shortReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnShortTest(shortTest); - System.out.println("Short Return: " + shortReturn ); + // short shortReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnShortTest(shortTest); + // System.out.println("Short Return: " + shortReturn ); - int intReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnIntTest(intTest); - System.out.println("Int Return: " + intReturn ); + // int intReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnIntTest(intTest); + // System.out.println("Int Return: " + intReturn ); - long longReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnLongTest(longTest); - System.out.println("Long Return: " + longReturn ); + // long longReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnLongTest(longTest); + // System.out.println("Long Return: " + longReturn ); - float floatReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnFloatTest(floatTest); - System.out.println("Float Return: " + floatReturn ); + // float floatReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnFloatTest(floatTest); + // System.out.println("Float Return: " + floatReturn ); - double doubleReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnDoubleTest(doubleTest); - System.out.println("Double Return: " + doubleReturn ); + // double doubleReturn = FRCNetworkCommunicationsLibrary.JNIValueReturnDoubleTest(doubleTest); + // System.out.println("Double Return: " + doubleReturn ); - String testValue = "This is a test string"; + // String testValue = "This is a test string"; - String returnValue = FRCNetworkCommunicationsLibrary.JNIObjectReturnStringTest(testValue); + // String returnValue = FRCNetworkCommunicationsLibrary.JNIObjectReturnStringTest(testValue); - System.out.println("String Return:" + returnValue); + // System.out.println("String Return:" + returnValue); - ByteBuffer directBuffer = ByteBuffer.allocateDirect(4); + // ByteBuffer directBuffer = ByteBuffer.allocateDirect(4); - directBuffer.put(0, (byte)0xFA); - directBuffer.put(1, (byte)0xAB); - directBuffer.put(2, (byte)0xB4); - directBuffer.put(3, (byte)0xCD); + // directBuffer.put(0, (byte)0xFA); + // directBuffer.put(1, (byte)0xAB); + // directBuffer.put(2, (byte)0xB4); + // directBuffer.put(3, (byte)0xCD); - ByteBuffer returnBuffer1 = FRCNetworkCommunicationsLibrary.JNIObjectReturnByteBufferTest(directBuffer); + // ByteBuffer returnBuffer1 = FRCNetworkCommunicationsLibrary.JNIObjectReturnByteBufferTest(directBuffer); - System.out.println("Return Buffer Capacity: " + returnBuffer1.capacity()); - System.out.println("ByteBuffer1 Return0: " + returnBuffer1.get(0) ); - System.out.println("ByteBuffer1 Return1: " + returnBuffer1.get(1) ); - System.out.println("ByteBuffer1 Return2: " + returnBuffer1.get(2) ); - System.out.println("ByteBuffer1 Return3: " + returnBuffer1.get(3) ); + // System.out.println("Return Buffer Capacity: " + returnBuffer1.capacity()); + // System.out.println("ByteBuffer1 Return0: " + returnBuffer1.get(0) ); + // System.out.println("ByteBuffer1 Return1: " + returnBuffer1.get(1) ); + // System.out.println("ByteBuffer1 Return2: " + returnBuffer1.get(2) ); + // System.out.println("ByteBuffer1 Return3: " + returnBuffer1.get(3) ); - ByteBuffer directByteBuffer = ByteBuffer.allocateDirect(4); - // set to little endian for C++ - directByteBuffer.order(ByteOrder.LITTLE_ENDIAN); + // ByteBuffer directByteBuffer = ByteBuffer.allocateDirect(4); + //set to little endian for C++ + // directByteBuffer.order(ByteOrder.LITTLE_ENDIAN); - directByteBuffer.putInt(0,2874933); + // directByteBuffer.putInt(0,2874933); - System.out.println("Param In: " + directByteBuffer.getInt(0)); - System.out.println("Param In Byte0: " + directByteBuffer.get(0) ); - System.out.println("Param In Byte1: " + directByteBuffer.get(1) ); - System.out.println("Param In Byte2: " + directByteBuffer.get(2) ); - System.out.println("Param In Byte3: " + directByteBuffer.get(3) ); + // System.out.println("Param In: " + directByteBuffer.getInt(0)); + // System.out.println("Param In Byte0: " + directByteBuffer.get(0) ); + // System.out.println("Param In Byte1: " + directByteBuffer.get(1) ); + // System.out.println("Param In Byte2: " + directByteBuffer.get(2) ); + // System.out.println("Param In Byte3: " + directByteBuffer.get(3) ); - ByteBuffer returnBuffer2 = FRCNetworkCommunicationsLibrary.JNIObjectAndParamReturnIntBufferTest(directByteBuffer.asIntBuffer()); + // ByteBuffer returnBuffer2 = FRCNetworkCommunicationsLibrary.JNIObjectAndParamReturnIntBufferTest(directByteBuffer.asIntBuffer()); - System.out.println("Param Out: " + directByteBuffer.getInt(0)); - - - - System.out.println("Return Buffer Capacity: " + returnBuffer2.capacity()); - System.out.println("ByteBuffer2 Return0: " + returnBuffer2.get(0) ); - System.out.println("ByteBuffer2 Return1: " + returnBuffer2.get(1) ); - System.out.println("ByteBuffer2 Return2: " + returnBuffer2.get(2) ); - System.out.println("ByteBuffer2 Return3: " + returnBuffer2.get(3) ); - - System.out.println("Byte Order from C++" + returnBuffer2.order().toString()); - System.out.println("ByteBuffer2 as Int" + returnBuffer2.getInt(0)); - // change to little endian - returnBuffer2.order(ByteOrder.LITTLE_ENDIAN); - System.out.println("ByteBuffer2 as Int" + returnBuffer2.getInt(0)); + // System.out.println("Param Out: " + directByteBuffer.getInt(0)); + // System.out.println("Return Buffer Capacity: " + returnBuffer2.capacity()); + // System.out.println("ByteBuffer2 Return0: " + returnBuffer2.get(0) ); + // System.out.println("ByteBuffer2 Return1: " + returnBuffer2.get(1) ); + // System.out.println("ByteBuffer2 Return2: " + returnBuffer2.get(2) ); + // System.out.println("ByteBuffer2 Return3: " + returnBuffer2.get(3) ); + // System.out.println("Byte Order from C++" + returnBuffer2.order().toString()); + // System.out.println("ByteBuffer2 as Int" + returnBuffer2.getInt(0)); + //change to little endian + // returnBuffer2.order(ByteOrder.LITTLE_ENDIAN); + // System.out.println("ByteBuffer2 as Int" + returnBuffer2.getInt(0)); /* End JNI Testing */ - FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationReserve(); FRCNetworkCommunicationsLibrary.FRCNetworkCommunicationObserveUserProgramStarting(); - Watchdog.getInstance().setExpiration(0.1); - Watchdog.getInstance().setEnabled(false); UsageReporting.report(tResourceType.kResourceType_Language, tInstances.kLanguage_Java); diff --git a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/Watchdog.java b/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/Watchdog.java deleted file mode 100644 index c0dba57f80..0000000000 --- a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/Watchdog.java +++ /dev/null @@ -1,206 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) FIRST 2008-2012. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ -package edu.wpi.first.wpilibj; - -import java.util.logging.*; -import java.nio.ByteOrder; -import java.nio.IntBuffer; -import java.nio.ByteBuffer; - -//import com.sun.jna.Pointer; - - -import edu.wpi.first.wpilibj.hal.WatchdogJNI; -import edu.wpi.first.wpilibj.hal.HALUtil; -import edu.wpi.first.wpilibj.parsing.IUtility; - -/** - * Watchdog timer class. The watchdog timer is designed to keep the robots safe. - * The idea is that the robot program must constantly "feed" the watchdog - * otherwise it will shut down all the motor outputs. That way if a program - * breaks, rather than having the robot continue to operate at the last known - * speed, the motors will be shut down. - * - * This is serious business. Don't just disable the watchdog. You can't afford - * it! - * - * http://thedailywtf.com/Articles/_0x2f__0x2f_TODO_0x3a__Uncomment_Later.aspx - */ -public class Watchdog extends SensorBase implements IUtility { - private static Logger logger = Logger.getLogger("Watchdog"); - private static ConsoleHandler ch = new ConsoleHandler(); - private static Watchdog m_instance; - private ByteBuffer m_watchDog; - - static - { - logger.addHandler(ch); - logger.setLevel(Level.ALL); - } - - /** - * The Watchdog is born. - */ - protected Watchdog() { - // allocate direct - ByteBuffer status = ByteBuffer.allocateDirect(4); - // set the byte order - status.order(ByteOrder.LITTLE_ENDIAN); - m_watchDog = WatchdogJNI.initializeWatchdog(status.asIntBuffer()); - // set the byte order for the return value - m_watchDog.order(ByteOrder.LITTLE_ENDIAN); - logger.info("Initialize Watchdog Status = " + status.getInt(0) ); - logger.info("Watchdog Handle Length = " + m_watchDog.capacity() ); - logger.info("Watchdog Handle Value:" + m_watchDog.getInt(0)); - HALUtil.checkStatus(status.asIntBuffer()); - } - - /** - * Get an instance of the watchdog - * - * @return an instance of the watchdog - */ - public static synchronized Watchdog getInstance() { - if (m_instance == null) { - m_instance = new Watchdog(); - } - return m_instance; - } - - /** - * Throw the dog a bone. - * - * When everything is going well, you feed your dog when you get home. Let's - * hope you don't drive your car off a bridge on the way home... Your dog - * won't get fed and he will starve to death. - * - * By the way, it's not cool to ask the neighbor (some random task) to feed - * your dog for you. He's your responsibility! - */ - public void feed() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - WatchdogJNI.feedWatchdog(m_watchDog, status); - HALUtil.checkStatus(status); - } - - /** - * Put the watchdog out of its misery. - * - * Don't wait for your dying robot to starve when there is a problem. Kill - * it quickly, cleanly, and humanely. - */ - public void kill() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - WatchdogJNI.killWatchdog(m_watchDog, status); - HALUtil.checkStatus(status); - } - - /** - * Read how long it has been since the watchdog was last fed. - * - * @return The number of seconds since last meal. - */ - public double getTimer() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - double value = WatchdogJNI.getWatchdogLastFed(m_watchDog, status); - HALUtil.checkStatus(status); - return value; - } - - /** - * Read what the current expiration is. - * - * @return The number of seconds before starvation following a meal - * (watchdog starves if it doesn't eat this often). - */ - public double getExpiration() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - double value = WatchdogJNI.getWatchdogExpiration(m_watchDog, status); - HALUtil.checkStatus(status); - return value; - } - - /** - * Configure how many seconds your watchdog can be neglected before it - * starves to death. - * - * @param expiration - * The number of seconds before starvation following a meal - * (watchdog starves if it doesn't eat this often). - */ - public void setExpiration(double expiration) { - // allocate direct - ByteBuffer status = ByteBuffer.allocateDirect(4); - // set to c++ byte order - status.order(ByteOrder.LITTLE_ENDIAN); - WatchdogJNI.setWatchdogExpiration(m_watchDog, expiration, status.asIntBuffer()); - HALUtil.checkStatus(status.asIntBuffer()); - } - - /** - * Find out if the watchdog is currently enabled or disabled (mortal or - * immortal). - * - * @return Enabled or disabled. - */ - public boolean getEnabled() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - boolean value = WatchdogJNI.getWatchdogEnabled(m_watchDog, status) != 0; - HALUtil.checkStatus(status); - return value; - } - - /** - * Enable or disable the watchdog timer. - * - * When enabled, you must keep feeding the watchdog timer to keep the - * watchdog active, and hence the dangerous parts (motor outputs, etc.) can - * keep functioning. When disabled, the watchdog is immortal and will remain - * active even without being fed. It will also ignore any kill commands - * while disabled. - * - * @param enabled - * Enable or disable the watchdog. - */ - public void setEnabled(final boolean enabled) { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - WatchdogJNI.setWatchdogEnabled(m_watchDog, (byte) (enabled ? 1 : 0), - status); - HALUtil.checkStatus(status); - } - - /** - * Check in on the watchdog and make sure he's still kicking. - * - * This indicates that your watchdog is allowing the system to operate. It - * is still possible that the network communications is not allowing the - * system to run, but you can check this to make sure it's not your fault. - * Check isSystemActive() for overall system status. - * - * If the watchdog is disabled, then your watchdog is immortal. - * - * @return Is the watchdog still alive? - */ - public boolean isAlive() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - boolean value = WatchdogJNI.isWatchdogAlive(m_watchDog, status) != 0; - HALUtil.checkStatus(status); - return value; - } - - /** - * Check on the overall status of the system. - * - * @return Is the system active (i.e. PWM motor outputs, etc. enabled)? - */ - public boolean isSystemActive() { - IntBuffer status = ByteBuffer.allocateDirect(4).asIntBuffer(); - boolean value = WatchdogJNI.isWatchdogSystemActive(m_watchDog, status) != 0; - HALUtil.checkStatus(status); - return value; - } -} diff --git a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/hal/WatchdogJNI.java b/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/hal/WatchdogJNI.java deleted file mode 100644 index 76a578b2fc..0000000000 --- a/wpilibj/wpilibJava/src/main/java/edu/wpi/first/wpilibj/hal/WatchdogJNI.java +++ /dev/null @@ -1,19 +0,0 @@ -package edu.wpi.first.wpilibj.hal; - -import java.nio.IntBuffer; -import java.nio.ByteBuffer; - -public class WatchdogJNI extends JNIWrapper { - public static native ByteBuffer initializeWatchdog(IntBuffer status); - public static native void cleanWatchdog(ByteBuffer watchdog_pointer, IntBuffer status); - public static native byte feedWatchdog(ByteBuffer watchdog_pointer, IntBuffer status); - public static native void killWatchdog(ByteBuffer watchdog_pointer, IntBuffer status); - public static native double getWatchdogLastFed(ByteBuffer watchdog_pointer, IntBuffer status); - public static native double getWatchdogExpiration(ByteBuffer watchdog_pointer, IntBuffer status); - public static native void setWatchdogExpiration(ByteBuffer watchdog_pointer, double expiration, IntBuffer status); - public static native byte getWatchdogEnabled(ByteBuffer watchdog_pointer, IntBuffer status); - public static native void setWatchdogEnabled(ByteBuffer watchdog_pointer, byte enabled, IntBuffer status); - public static native byte isWatchdogAlive(ByteBuffer watchdog_pointer, IntBuffer status); - public static native byte isWatchdogSystemActive(ByteBuffer watchdog_pointer, IntBuffer status); - -} diff --git a/wpilibj/wpilibJavaJNI/pom.xml b/wpilibj/wpilibJavaJNI/pom.xml index 7a0bb2961b..e69b093e62 100644 --- a/wpilibj/wpilibJavaJNI/pom.xml +++ b/wpilibj/wpilibJavaJNI/pom.xml @@ -119,7 +119,6 @@ this default location, specify a value for the 'embeddedJDKHome' property at the edu.wpi.first.wpilibj.hal.PWMJNI edu.wpi.first.wpilibj.hal.RelayJNI edu.wpi.first.wpilibj.hal.SPIJNI - edu.wpi.first.wpilibj.hal.WatchdogJNI diff --git a/wpilibj/wpilibJavaJNI/src/main/native/WatchdogJNI.cpp b/wpilibj/wpilibJavaJNI/src/main/native/WatchdogJNI.cpp deleted file mode 100644 index 4bc1e46ab2..0000000000 --- a/wpilibj/wpilibJavaJNI/src/main/native/WatchdogJNI.cpp +++ /dev/null @@ -1,208 +0,0 @@ -#include -#include -#include "Log.h" - -#include "edu_wpi_first_wpilibj_hal_WatchdogJNI.h" - -#include "HAL/Watchdog.h" -// set the logging level -TLogLevel watchdogJNILogLevel = logDEBUG; - -#define WATCHDOGJNI_LOG(level) \ - if (level > watchdogJNILogLevel) ; \ - else Log().Get(level) - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: initializeWatchdog - * Signature: (Ljava/nio/IntBuffer;)Ljava/nio/ByteBuffer; - */ -JNIEXPORT jobject JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_initializeWatchdog - (JNIEnv * env, jclass, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog initializeWatchdog"; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - WATCHDOGJNI_LOG(logDEBUG) << "Status Ptr = " << statusPtr; - jlong statusCapacity = env->GetDirectBufferCapacity(status); - WATCHDOGJNI_LOG(logDEBUG) << "Status Capacity = " << statusCapacity; - void** watchdogPtr = (void**)new unsigned char[4]; - *watchdogPtr = initializeWatchdog(statusPtr); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *watchdogPtr; - return env->NewDirectByteBuffer( watchdogPtr, 4); -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: cleanWatchdog - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_cleanWatchdog - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog cleanWatchdog"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - cleanWatchdog( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: feedWatchdog - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)B - */ -JNIEXPORT jbyte JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_feedWatchdog - (JNIEnv * env, jclass, jobject id, jobject status ) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog feedWatchdog"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - jbyte returnValue = feedWatchdog( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "feedWatchdog return = " << (short)returnValue; - return returnValue; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: killWatchdog - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_killWatchdog - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog killWatchdog"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - killWatchdog( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: getWatchdogLastFed - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)D - */ -JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_getWatchdogLastFed - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog getWatchdogLastFed"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - double returnValue = getWatchdogLastFed( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "LastFed = " << returnValue; - return returnValue; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: getWatchdogExpiration - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)D - */ -JNIEXPORT jdouble JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_getWatchdogExpiration - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog getWatchdogExpiration"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - double returnValue = getWatchdogExpiration( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "Expiration = " << returnValue; - return returnValue; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: setWatchdogExpiration - * Signature: (Ljava/nio/ByteBuffer;DLjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_setWatchdogExpiration - (JNIEnv * env, jclass, jobject id, jdouble value, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog setWatchdogExpiration"; - WATCHDOGJNI_LOG(logDEBUG) << "Expiration = " << value; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - setWatchdogExpiration( *javaId, value, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: getWatchdogEnabled - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)B - */ -JNIEXPORT jbyte JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_getWatchdogEnabled - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog getWatchdogEnabled"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - jbyte returnValue = getWatchdogEnabled( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "Enabled = " << (short)returnValue; - return returnValue; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: setWatchdogEnabled - * Signature: (Ljava/nio/ByteBuffer;BLjava/nio/IntBuffer;)V - */ -JNIEXPORT void JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_setWatchdogEnabled - (JNIEnv * env, jclass, jobject id, jbyte value, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog setWatchdogEnabled"; - WATCHDOGJNI_LOG(logDEBUG) << "Enabled = " << (short)value; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - setWatchdogEnabled( *javaId, value, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: isWatchdogAlive - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)B - */ -JNIEXPORT jbyte JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_isWatchdogAlive - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog isWatchdogAlive"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - jbyte returnValue = isWatchdogAlive( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "IsAlive = " << (short)returnValue; - return returnValue; -} - -/* - * Class: edu_wpi_first_wpilibj_hal_WatchdogJNI - * Method: isWatchdogSystemActive - * Signature: (Ljava/nio/ByteBuffer;Ljava/nio/IntBuffer;)B - */ -JNIEXPORT jbyte JNICALL Java_edu_wpi_first_wpilibj_hal_WatchdogJNI_isWatchdogSystemActive - (JNIEnv * env, jclass, jobject id, jobject status) -{ - WATCHDOGJNI_LOG(logDEBUG) << "Calling Watchdog isWatchdogSystemActive"; - void ** javaId = (void**)env->GetDirectBufferAddress(id); - WATCHDOGJNI_LOG(logDEBUG) << "Watchdog Ptr = " << *javaId; - jint * statusPtr = (jint*)env->GetDirectBufferAddress(status); - jbyte returnValue = isWatchdogSystemActive( *javaId, statusPtr ); - WATCHDOGJNI_LOG(logDEBUG) << "Status = " << *statusPtr; - WATCHDOGJNI_LOG(logDEBUG) << "IsActive = " << (short)returnValue; - return returnValue; -} -