Skip to content

Commit

Permalink
🔖Release/3.6.2
Browse files Browse the repository at this point in the history
🔖Release/3.6.2
  • Loading branch information
WillXuCodes authored Jun 18, 2022
2 parents 8bcd0e6 + 69f1e7c commit cc71d47
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 60 deletions.
54 changes: 27 additions & 27 deletions firmware/v5-common.ld
Original file line number Diff line number Diff line change
Expand Up @@ -27,46 +27,46 @@ SECTIONS
*(.vfp11_veneer)
*(.ARM.extab)
*(.gnu.linkonce.armextab.*)
} > MEMORY
} > RAM

.init : {
KEEP (*(.init))
} > MEMORY
} > RAM

.fini : {
KEEP (*(.fini))
} > MEMORY
} > RAM

.rodata : {
__rodata_start = .;
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r.*)
__rodata_end = .;
} > MEMORY
} > RAM

.rodata1 : {
__rodata1_start = .;
*(.rodata1)
*(.rodata1.*)
__rodata1_end = .;
} > MEMORY
} > RAM

.sdata2 : {
__sdata2_start = .;
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
__sdata2_end = .;
} > MEMORY
} > RAM

.sbss2 : {
__sbss2_start = .;
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
__sbss2_end = .;
} > MEMORY
} > RAM

.data : {
__data_start = .;
Expand All @@ -77,18 +77,18 @@ SECTIONS
*(.got)
*(.got.plt)
__data_end = .;
} > MEMORY
} > RAM

.data1 : {
__data1_start = .;
*(.data1)
*(.data1.*)
__data1_end = .;
} > MEMORY
} > RAM

.got : {
*(.got)
} > MEMORY
} > RAM

.ctors : {
__CTOR_LIST__ = .;
Expand All @@ -99,7 +99,7 @@ SECTIONS
KEEP (*(.ctors))
__CTOR_END__ = .;
___CTORS_END___ = .;
} > MEMORY
} > RAM

.dtors : {
__DTOR_LIST__ = .;
Expand All @@ -110,99 +110,99 @@ SECTIONS
KEEP (*(.dtors))
__DTOR_END__ = .;
___DTORS_END___ = .;
} > MEMORY
} > RAM

.fixup : {
__fixup_start = .;
*(.fixup)
__fixup_end = .;
} > MEMORY
} > RAM

.eh_frame : {
*(.eh_frame)
} > MEMORY
} > RAM

.eh_framehdr : {
__eh_framehdr_start = .;
*(.eh_framehdr)
__eh_framehdr_end = .;
} > MEMORY
} > RAM

.gcc_except_table : {
*(.gcc_except_table)
} > MEMORY
} > RAM

.mmu_tbl (ALIGN(16384)) : {
__mmu_tbl_start = .;
*(.mmu_tbl)
__mmu_tbl_end = .;
} > MEMORY
} > RAM

.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx*)
*(.gnu.linkonce.armexidix.*.*)
__exidx_end = .;
} > MEMORY
} > RAM

.preinit_array : {
__preinit_array_start = .;
KEEP (*(SORT(.preinit_array.*)))
KEEP (*(.preinit_array))
__preinit_array_end = .;
} > MEMORY
} > RAM

.init_array : {
__init_array_start = .;
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
__init_array_end = .;
} > MEMORY
} > RAM

.fini_array : {
__fini_array_start = .;
KEEP (*(SORT(.fini_array.*)))
KEEP (*(.fini_array))
__fini_array_end = .;
} > MEMORY
} > RAM

.ARM.attributes : {
__ARM.attributes_start = .;
*(.ARM.attributes)
__ARM.attributes_end = .;
} > MEMORY
} > RAM

.sdata : {
__sdata_start = .;
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
__sdata_end = .;
} > MEMORY
} > RAM

.sbss (NOLOAD) : {
__sbss_start = .;
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
__sbss_end = .;
} > MEMORY
} > RAM

.tdata : {
__tdata_start = .;
*(.tdata)
*(.tdata.*)
*(.gnu.linkonce.td.*)
__tdata_end = .;
} > MEMORY
} > RAM

.tbss : {
__tbss_start = .;
*(.tbss)
*(.tbss.*)
*(.gnu.linkonce.tb.*)
__tbss_end = .;
} > MEMORY
} > RAM

.bss (NOLOAD) : {
__bss_start = .;
Expand All @@ -211,7 +211,7 @@ SECTIONS
*(.gnu.linkonce.b.*)
*(COMMON)
__bss_end = .;
} > MEMORY
} > RAM

_SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 );

Expand Down
2 changes: 1 addition & 1 deletion firmware/v5-hot.ld
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ MEMORY
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
}

REGION_ALIAS("MEMORY", HOT_MEMORY);
REGION_ALIAS("RAM", HOT_MEMORY);

ENTRY(install_hot_table)
2 changes: 1 addition & 1 deletion firmware/v5.ld
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ MEMORY
HOT_MEMORY : ORIGIN = start_of_hot_mem, LENGTH = _HOT_MEM_SIZE /* Just over 8 MB */
}

REGION_ALIAS("MEMORY", COLD_MEMORY);
REGION_ALIAS("RAM", COLD_MEMORY);

ENTRY(vexStartup)
4 changes: 2 additions & 2 deletions include/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@

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

#define PROS_ERR (INT32_MAX)
#define PROS_ERR_F (INFINITY)
Expand Down
42 changes: 14 additions & 28 deletions src/devices/vdml_imu.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ double imu_get_heading(uint8_t port) {
claim_port_f(port - 1, E_DEVICE_IMU);
ERROR_IMU_STILL_CALIBRATING(port, device, PROS_ERR_F);
double rtn = vexDeviceImuDegreesGet(device->device_info) + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->heading_offset;
if (rtn > IMU_HEADING_MAX) rtn -= IMU_HEADING_MAX;
if (rtn < 0) rtn += IMU_HEADING_MAX;
return_port(port - 1, rtn);
// Restricting value to raw boundaries
return_port(port - 1, fmod((rtn + IMU_HEADING_MAX), (double) IMU_HEADING_MAX));
}

#define QUATERNION_ERR_INIT \
Expand All @@ -107,16 +106,9 @@ quaternion_s_t imu_get_quaternion(uint8_t port) {
imu_data_s_t* data = (imu_data_s_t*)device->pad;
// To calculate the quaternion values, we first get the euler values, add the offsets,
// and then do the calculations.
double roll = euler.roll + data->roll_offset;
double yaw = euler.yaw + data->yaw_offset;
double pitch = euler.pitch + data->pitch_offset;

if (roll > IMU_EULER_LIMIT) roll -= 2 * IMU_EULER_LIMIT;
if (roll < -IMU_EULER_LIMIT) roll += 2 * IMU_EULER_LIMIT;
if (yaw > IMU_EULER_LIMIT) yaw -= 2 * IMU_EULER_LIMIT;
if (yaw < -IMU_EULER_LIMIT) yaw += 2 * IMU_EULER_LIMIT;
if (pitch > IMU_EULER_LIMIT) pitch -= 2 * IMU_EULER_LIMIT;
if (pitch < -IMU_EULER_LIMIT) pitch += 2 * IMU_EULER_LIMIT;
double roll = fmod(euler.roll + data->roll_offset, 2.0 * IMU_EULER_LIMIT);
double yaw = fmod(euler.yaw + data->yaw_offset, 2.0 * IMU_EULER_LIMIT);
double pitch = fmod(euler.pitch + data->pitch_offset, 2.0 * IMU_EULER_LIMIT);

double cy = cos(DEGTORAD * yaw * 0.5);
double sy = sin(DEGTORAD * yaw * 0.5);
Expand Down Expand Up @@ -148,12 +140,9 @@ euler_s_t imu_get_euler(uint8_t port) {
rtn.pitch += data->pitch_offset;
rtn.yaw += data->yaw_offset;
rtn.roll += data->roll_offset;
if (rtn.roll > IMU_EULER_LIMIT) rtn.roll -= 2 * IMU_EULER_LIMIT;
if (rtn.roll < -IMU_EULER_LIMIT) rtn.roll += 2 * IMU_EULER_LIMIT;
if (rtn.yaw > IMU_EULER_LIMIT) rtn.yaw -= 2 * IMU_EULER_LIMIT;
if (rtn.yaw < -IMU_EULER_LIMIT) rtn.yaw += 2 * IMU_EULER_LIMIT;
if (rtn.pitch > IMU_EULER_LIMIT) rtn.pitch -= 2 * IMU_EULER_LIMIT;
if (rtn.pitch < -IMU_EULER_LIMIT) rtn.pitch += 2 * IMU_EULER_LIMIT;
rtn.roll = fmod(rtn.roll, 2.0 * IMU_EULER_LIMIT);
rtn.yaw = fmod(rtn.yaw, 2.0 * IMU_EULER_LIMIT);
rtn.pitch = fmod(rtn.pitch, 2.0 * IMU_EULER_LIMIT);
return_port(port - 1, rtn);
}

Expand All @@ -166,9 +155,8 @@ double imu_get_pitch(uint8_t port) {
v5_smart_device_s_t* device = registry_get_device(port - 1);
vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values);
rtn = euler_values.pitch + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->pitch_offset;
if (rtn > IMU_EULER_LIMIT) rtn -= 2 * IMU_EULER_LIMIT;
if (rtn < -IMU_EULER_LIMIT) rtn += 2 * IMU_EULER_LIMIT;
return_port(port - 1, rtn);
// Restricting value to raw boundaries
return_port(port - 1, fmod(rtn, 2.0 * IMU_EULER_LIMIT));
}

double imu_get_roll(uint8_t port) {
Expand All @@ -180,9 +168,8 @@ double imu_get_roll(uint8_t port) {
v5_smart_device_s_t* device = registry_get_device(port - 1);
vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values);
rtn = euler_values.roll + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->roll_offset;
if (rtn > IMU_EULER_LIMIT) rtn -= 2 * IMU_EULER_LIMIT;
if (rtn < -IMU_EULER_LIMIT) rtn += 2 * IMU_EULER_LIMIT;
return_port(port - 1, rtn);
// Restricting value to raw boundaries
return_port(port - 1, fmod(rtn, 2.0 * IMU_EULER_LIMIT));
}

double imu_get_yaw(uint8_t port) {
Expand All @@ -194,9 +181,8 @@ double imu_get_yaw(uint8_t port) {
v5_smart_device_s_t* device = registry_get_device(port - 1);
vexDeviceImuAttitudeGet(device->device_info, (V5_DeviceImuAttitude*)&euler_values);
rtn = euler_values.yaw + ((imu_data_s_t*)registry_get_device(port - 1)->pad)->yaw_offset;
if (rtn > IMU_EULER_LIMIT) rtn -= 2 * IMU_EULER_LIMIT;
if (rtn < -IMU_EULER_LIMIT) rtn += 2 * IMU_EULER_LIMIT;
return_port(port - 1, rtn);
// Restricting value to raw boundaries
return_port(port - 1, fmod(rtn, 2.0 * IMU_EULER_LIMIT));
}

#define RAW_IMU_ERR_INIT {.x = PROS_ERR_F, .y = PROS_ERR_F, .z = PROS_ERR_F};
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.1
3.6.2

0 comments on commit cc71d47

Please sign in to comment.