Skip to content

Commit

Permalink
🔖Release 3.7.0
Browse files Browse the repository at this point in the history
🔖Release 3.7.0
  • Loading branch information
WillXuCodes authored Aug 29, 2022
2 parents cc71d47 + db7cc8a commit 1c8120a
Show file tree
Hide file tree
Showing 26 changed files with 1,111 additions and 143 deletions.
9 changes: 4 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
jobs:
- job: BuildTemplate
variables:
toolchain_update_short: 8-2019q3
toolchain_update: 8-2019-q3
toolchain: https://developer.arm.com/-/media/Files/downloads/gnu-rm/$(toolchain_update_short)/RC1.1/gcc-arm-none-eabi-$(toolchain_update)-update-linux.tar.bz2
toolchain_update: 10.3-2021.10
toolchain: https://developer.arm.com/-/media/Files/downloads/gnu-rm/$(toolchain_update)/gcc-arm-none-eabi-$(toolchain_update)-x86_64-linux.tar.bz2
pool:
vmImage: 'ubuntu-latest'
steps:
Expand All @@ -16,7 +15,7 @@ jobs:
- bash: |
curl -LSso toolchain.tar.bz2 $(toolchain)
tar -xjvf toolchain.tar.bz2
echo "##vso[task.prependpath]$(pwd)/gcc-arm-none-eabi-$(toolchain_update)-update/bin"
echo "##vso[task.prependpath]$(pwd)/gcc-arm-none-eabi-$(toolchain_update)/bin"
displayName: Install gcc-arm-embedded
- task: UsePythonVersion@0
inputs:
Expand All @@ -27,7 +26,7 @@ jobs:
artifactFeeds: 'pros-cli'
# use official PyPi registry first and fall back to internal feed as needed
onlyAddExtraIndex: true
- bash: pip install pros-cli==3.2.3
- bash: pip install pros-cli
displayName: Install CLI
- bash: |
make template
Expand Down
10 changes: 4 additions & 6 deletions include/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@
#endif /* __cplusplus */

#define PROS_VERSION_MAJOR 3
#define PROS_VERSION_MINOR 6
#define PROS_VERSION_PATCH 2
#define PROS_VERSION_STRING "3.6.2"

#define PROS_ERR (INT32_MAX)
#define PROS_ERR_F (INFINITY)
#define PROS_VERSION_MINOR 7
#define PROS_VERSION_PATCH 0
#define PROS_VERSION_STRING "3.7.0"

#include "pros/adi.h"
#include "pros/colors.h"
#include "pros/distance.h"
#include "pros/error.h"
#include "pros/ext_adi.h"
#include "pros/gps.h"
#include "pros/imu.h"
Expand Down
2 changes: 1 addition & 1 deletion include/pros/colors.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#define RGB2COLOR(R, G, B) ((R & 0xff) << 16 | (G & 0xff) << 8 | (B & 0xff))
#define COLOR2R(COLOR) ((COLOR >> 16) & 0xff)
#define COLOR2G(COLOR) ((COLOR >> 8) && 0xff)
#define COLOR2G(COLOR) ((COLOR >> 8) & 0xff)
#define COLOR2B(COLOR) (COLOR & 0xff)

#define COLOR_ALICE_BLUE 0x00F0F8FF
Expand Down
29 changes: 29 additions & 0 deletions include/pros/error.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* \file pros/error.h
*
* Contains macro definitions for return types, mostly errors
*
* This file should not be modified by users, since it gets replaced whenever
* a kernel upgrade occurs.
*
* Copyright (c) 2017-2022, Purdue University ACM SIGBots.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef _PROS_ERROR_H_
#define _PROS_ERROR_H_

#include "limits.h"

// Different Byte Size Errors
#define PROS_ERR_BYTE (INT8_MAX)
#define PROS_ERR_2_BYTE (INT16_MAX)
#define PROS_ERR (INT32_MAX)
#define PROS_ERR_F (INFINITY)

// Return This on Success
#define PROS_SUCCESS (1)

#endif
31 changes: 31 additions & 0 deletions include/pros/imu.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ typedef struct __attribute__((__packed__)) euler_s {
double yaw;
} euler_s_t;

#ifdef PROS_USE_SIMPLE_NAMES
#ifdef __cplusplus
#define IMU_STATUS_CALIBRATING pros::E_IMU_STATUS_CALIBRATING
#define IMU_STATUS_ERROR pros::E_IMU_STATUS_ERROR
#else
#define IMU_STATUS_CALIBRATING E_IMU_STATUS_CALIBRATING
#define IMU_STATUS_ERROR E_IMU_STATUS_ERROR
#endif
#endif

#define IMU_MINIMUM_DATA_RATE 5

/**
Expand All @@ -78,6 +88,27 @@ typedef struct __attribute__((__packed__)) euler_s {
*/
int32_t imu_reset(uint8_t port);

/**
* Calibrate IMU and Blocks while Calibrating
*
* Calibration takes approximately 2 seconds and blocks during this period,
* with a timeout for this operation being set a 3 seconds as a safety margin.
* Like the other reset function, this function also blocks until the IMU
* status flag is set properly to E_IMU_STATUS_CALIBRATING, with a minimum
* blocking time of 5ms and a timeout of 1 second if it's never set.
*
* This function uses the following values of errno when an error state is
* reached:
* ENXIO - The given value is not within the range of V5 ports (1-21).
* ENODEV - The port cannot be configured as an Inertial Sensor
* EAGAIN - The sensor is already calibrating, or time out setting the status flag.
*
* \param port
* The V5 Inertial Sensor port number from 1-21
* \return 1 if the operation was successful or PROS_ERR if the operation
* failed (timing out or port claim failure), setting errno.
*/
int32_t imu_reset_blocking(uint8_t port);

/**
* Set the Inertial Sensor's refresh interval in milliseconds.
Expand Down
15 changes: 10 additions & 5 deletions include/pros/imu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,24 @@ class Imu {
/**
* Calibrate IMU
*
* Calibration takes approximately 2 seconds, but this function only blocks
* until the IMU status flag is set properly to E_IMU_STATUS_CALIBRATING,
* with a minimum blocking time of 5ms.
* Calibration takes approximately 2 seconds and blocks during this period if
* the blocking param is true, with a timeout for this operation being set a 3
* seconds as a safety margin. This function also blocks until the IMU
* status flag is set properly to E_IMU_STATUS_CALIBRATING, with a minimum
* blocking time of 5ms and a timeout of 1 second if it's never set.
*
* This function uses the following values of errno when an error state is
* reached:
* ENXIO - The given value is not within the range of V5 ports (1-21).
* ENODEV - The port cannot be configured as an Inertial Sensor
* EAGAIN - The sensor is already calibrating, or time out setting the status flag.
*
* \param blocking
* Whether this function blocks during calibration.
* \return 1 if the operation was successful or PROS_ERR if the operation
* failed, setting errno.
*/
virtual std::int32_t reset() const;
virtual std::int32_t reset(bool blocking = false) const;
/**
* Set the Inertial Sensor's refresh interval in milliseconds.
*
Expand All @@ -63,7 +67,8 @@ class Imu {
* ENODEV - The port cannot be configured as an Inertial Sensor
* EAGAIN - The sensor is still calibrating
*
* \param rate The data refresh interval in milliseconds
* \param rate
* The data refresh interval in milliseconds
* \return 1 if the operation was successful or PROS_ERR if the operation
* failed, setting errno.
*/
Expand Down
20 changes: 19 additions & 1 deletion include/pros/link.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,25 @@ namespace pros {

typedef enum link_type_e {
E_LINK_RECIEVER = 0,
E_LINK_TRANSMITTER
E_LINK_TRANSMITTER,
E_LINK_RX = E_LINK_RECIEVER,
E_LINK_TX = E_LINK_TRANSMITTER
} link_type_e_t;

#ifdef PROS_USE_SIMPLE_NAMES
#ifdef __cplusplus
#define LINK_RECIEVER pros::E_LINK_RECIEVER
#define LINK_TRANSMITTER pros::E_LINK_TRANSMITTER
#define LINK_RX pros::E_LINK_RX
#define LINK_TX pros::E_LINK_TX
#else
#define LINK_RECIEVER E_LINK_RECIEVER
#define LINK_TRANSMITTER E_LINK_TRANSMITTER
#define LINK_RX E_LINK_RX
#define LINK_TX E_LINK_TX
#endif
#endif

#define LINK_BUFFER_SIZE 512

#ifdef __cplusplus
Expand All @@ -41,6 +57,7 @@ namespace c {
/**
* Initializes a link on a radio port, with an indicated type. There might be a
* 1 to 2 second delay from when this function is called to when the link is initializes.
* PROS currently only supports the use of one radio per brain.
*
* This function uses the following values of errno when an error state is
* reached:
Expand All @@ -66,6 +83,7 @@ uint32_t link_init(uint8_t port, const char* link_id, link_type_e_t type);
* Initializes a link on a radio port, with an indicated type and the ability for
* vexlink to override the controller radio. There might be a 1 to 2 second delay
* from when this function is called to when the link is initializes.
* PROS currently only supports the use of one radio per brain.
*
* This function uses the following values of errno when an error state is
* reached:
Expand Down
18 changes: 18 additions & 0 deletions include/pros/motors.h
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,14 @@ typedef enum motor_encoder_units_e {
*/
typedef enum motor_gearset_e {
E_MOTOR_GEARSET_36 = 0, // 36:1, 100 RPM, Red gear set
E_MOTOR_GEAR_RED = E_MOTOR_GEARSET_36,
E_MOTOR_GEAR_100 = E_MOTOR_GEARSET_36,
E_MOTOR_GEARSET_18 = 1, // 18:1, 200 RPM, Green gear set
E_MOTOR_GEAR_GREEN = E_MOTOR_GEARSET_18,
E_MOTOR_GEAR_200 = E_MOTOR_GEARSET_18,
E_MOTOR_GEARSET_06 = 2, // 6:1, 600 RPM, Blue gear set
E_MOTOR_GEAR_BLUE = E_MOTOR_GEARSET_06,
E_MOTOR_GEAR_600 = E_MOTOR_GEARSET_06,
E_MOTOR_GEARSET_INVALID = INT32_MAX
} motor_gearset_e_t;

Expand All @@ -613,9 +619,15 @@ typedef enum motor_gearset_e {
#define MOTOR_ENCODER_COUNTS pros::E_MOTOR_ENCODER_COUNTS
#define MOTOR_ENCODER_INVALID pros::E_MOTOR_ENCODER_INVALID
#define MOTOR_GEARSET_36 pros::E_MOTOR_GEARSET_36
#define MOTOR_GEAR_RED pros::E_MOTOR_GEAR_RED
#define MOTOR_GEAR_100 pros::E_MOTOR_GEAR_100
#define MOTOR_GEARSET_18 pros::E_MOTOR_GEARSET_18
#define MOTOR_GEAR_GREEN pros::E_MOTOR_GEAR_GREEN
#define MOTOR_GEAR_200 pros::E_MOTOR_GEAR_200
#define MOTOR_GEARSET_06 pros::E_MOTOR_GEARSET_06
#define MOTOR_GEARSET_6 pros::E_MOTOR_GEARSET_06
#define MOTOR_GEAR_BLUE pros::E_MOTOR_GEAR_BLUE
#define MOTOR_GEAR_600 pros::E_MOTOR_GEAR_600
#define MOTOR_GEARSET_INVALID pros::E_MOTOR_GEARSET_INVALID
#else
#define MOTOR_BRAKE_COAST E_MOTOR_BRAKE_COAST
Expand All @@ -627,9 +639,15 @@ typedef enum motor_gearset_e {
#define MOTOR_ENCODER_COUNTS E_MOTOR_ENCODER_COUNTS
#define MOTOR_ENCODER_INVALID E_MOTOR_ENCODER_INVALID
#define MOTOR_GEARSET_36 E_MOTOR_GEARSET_36
#define MOTOR_GEAR_RED E_MOTOR_GEAR_RED
#define MOTOR_GEAR_100 E_MOTOR_GEAR_100
#define MOTOR_GEARSET_18 E_MOTOR_GEARSET_18
#define MOTOR_GEAR_GREEN E_MOTOR_GEAR_GREEN
#define MOTOR_GEAR_200 E_MOTOR_GEAR_200
#define MOTOR_GEARSET_06 E_MOTOR_GEARSET_06
#define MOTOR_GEARSET_6 E_MOTOR_GEARSET_06
#define MOTOR_GEAR_BLUE E_MOTOR_GEAR_BLUE
#define MOTOR_GEAR_600 E_MOTOR_GEAR_600
#define MOTOR_GEARSET_INVALID E_MOTOR_GEARSET_INVALID
#endif
#endif
Expand Down
Loading

0 comments on commit 1c8120a

Please sign in to comment.