-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hal] Initial SystemCore empty HAL (#7454)
- Loading branch information
Showing
100 changed files
with
20,131 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
#include "hal/Accelerometer.h" | ||
|
||
#include <stdint.h> | ||
|
||
#include <cassert> | ||
#include <cstdio> | ||
#include <memory> | ||
|
||
#include "HALInitializer.h" | ||
#include "hal/HAL.h" | ||
|
||
using namespace hal; | ||
|
||
namespace hal::init { | ||
void InitializeAccelerometer() {} | ||
} // namespace hal::init | ||
|
||
namespace hal { | ||
|
||
/** | ||
* Initialize the accelerometer. | ||
*/ | ||
static void initializeAccelerometer() { | ||
hal::init::CheckInit(); | ||
} | ||
|
||
} // namespace hal | ||
|
||
extern "C" { | ||
|
||
void HAL_SetAccelerometerActive(HAL_Bool active) { | ||
initializeAccelerometer(); | ||
} | ||
|
||
void HAL_SetAccelerometerRange(HAL_AccelerometerRange range) { | ||
initializeAccelerometer(); | ||
} | ||
|
||
double HAL_GetAccelerometerX(void) { | ||
initializeAccelerometer(); | ||
return 0.0; | ||
} | ||
|
||
double HAL_GetAccelerometerY(void) { | ||
initializeAccelerometer(); | ||
return 0.0; | ||
} | ||
|
||
double HAL_GetAccelerometerZ(void) { | ||
initializeAccelerometer(); | ||
return 0.0; | ||
} | ||
|
||
} // extern "C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
#include "hal/AddressableLED.h" | ||
|
||
#include <cstring> | ||
#include <memory> | ||
|
||
#include <fmt/format.h> | ||
|
||
#include "HALInitializer.h" | ||
#include "hal/Errors.h" | ||
|
||
using namespace hal; | ||
|
||
namespace hal::init { | ||
void InitializeAddressableLED() {} | ||
} // namespace hal::init | ||
|
||
extern "C" { | ||
|
||
HAL_AddressableLEDHandle HAL_InitializeAddressableLED( | ||
HAL_DigitalHandle outputPort, int32_t* status) { | ||
hal::init::CheckInit(); | ||
|
||
*status = HAL_HANDLE_ERROR; | ||
return HAL_kInvalidHandle; | ||
} | ||
|
||
void HAL_FreeAddressableLED(HAL_AddressableLEDHandle handle) {} | ||
|
||
void HAL_SetAddressableLEDOutputPort(HAL_AddressableLEDHandle handle, | ||
HAL_DigitalHandle outputPort, | ||
int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
|
||
void HAL_SetAddressableLEDLength(HAL_AddressableLEDHandle handle, | ||
int32_t length, int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
|
||
static_assert(sizeof(HAL_AddressableLEDData) == sizeof(uint32_t), | ||
"LED Data must be 32 bit"); | ||
|
||
void HAL_WriteAddressableLEDData(HAL_AddressableLEDHandle handle, | ||
const struct HAL_AddressableLEDData* data, | ||
int32_t length, int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
|
||
void HAL_SetAddressableLEDBitTiming(HAL_AddressableLEDHandle handle, | ||
int32_t highTime0NanoSeconds, | ||
int32_t lowTime0NanoSeconds, | ||
int32_t highTime1NanoSeconds, | ||
int32_t lowTime1NanoSeconds, | ||
int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
|
||
void HAL_SetAddressableLEDSyncTime(HAL_AddressableLEDHandle handle, | ||
int32_t syncTimeMicroSeconds, | ||
int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
|
||
void HAL_StartAddressableLEDOutput(HAL_AddressableLEDHandle handle, | ||
int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
|
||
void HAL_StopAddressableLEDOutput(HAL_AddressableLEDHandle handle, | ||
int32_t* status) { | ||
*status = HAL_HANDLE_ERROR; | ||
return; | ||
} | ||
} // extern "C" |
Oops, something went wrong.