Skip to content

Commit fa16219

Browse files
committed
Update all copyrights to be mjbots
1 parent 4c13a58 commit fa16219

28 files changed

+64
-35
lines changed

BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2020 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

WORKSPACE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018-2020 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

decode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22

3-
# Copyright 2021 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

fw/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018-2020 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

fw/BUILD~

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018-2020 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

fw/assert.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018-2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/fdcan.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/fdcan.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/fdcan_micro_server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/firmware_info.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/firmware_info.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/flash.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22

3-
# Copyright 2021 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

fw/git_info.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2021 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/git_info.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2021 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/git_info_linkstamp.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2021 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/lm5066.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/lm5066.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/millisecond_timer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/power_dist.cc

+37-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2021 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -454,12 +454,6 @@ void ConfigureADC(ADC_TypeDef* adc, int channel_sqr, fw::MillisecondTimer* timer
454454
adc->SMPR2 = make_cycles(2);
455455
}
456456

457-
uint16_t SampleAdc(ADC_TypeDef* adc) {
458-
adc->CR |= ADC_CR_ADSTART;
459-
while ((adc->ISR & ADC_ISR_EOC) == 0);
460-
return adc->DR;
461-
}
462-
463457
const int kShutdownTimeoutMs = 5000;
464458
const int kMinOffTimeMs = 500;
465459

@@ -487,6 +481,10 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
487481
float fet_temp_C = 0.0f;
488482
int32_t energy_uW_hr = 0;
489483

484+
int16_t int_temp_raw = 0;
485+
float int_temp_C = 0.0f;
486+
487+
490488
int32_t precharge_timeout_ms = 0;
491489
int32_t shutdown_timeout_ms = 0;
492490

@@ -511,6 +509,9 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
511509
a->Visit(MJ_NVP(fet_temp_C));
512510
a->Visit(MJ_NVP(energy_uW_hr));
513511

512+
a->Visit(MJ_NVP(int_temp_raw));
513+
a->Visit(MJ_NVP(int_temp_C));
514+
514515
a->Visit(MJ_NVP(precharge_timeout_ms));
515516
a->Visit(MJ_NVP(shutdown_timeout_ms));
516517

@@ -660,6 +661,7 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
660661
// DAC1 -> PA4 -> ISAMP_BIAS -> PA1 -> ADC12_IN2
661662
// DAC3 -> internal
662663
// DAC4 -> internal -> OPAMP5/VINP
664+
// Internal_TEMP -> ADC5/IN4
663665

664666
ConfigureDAC1(&timer_);
665667
ConfigureDAC3(&timer_);
@@ -669,6 +671,8 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
669671
ConfigureADC(ADC2, 16, &timer_);
670672
ConfigureADC(ADC3, 1, &timer_);
671673
ConfigureADC(ADC5, 1, &timer_);
674+
675+
ADC345_COMMON->CCR |= ADC_CCR_VSENSESEL;
672676
}
673677

674678
void Setup() {
@@ -815,6 +819,9 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
815819
ADC2->SQR1 =
816820
(0 << ADC_SQR1_L_Pos) | // length 1
817821
(16 << ADC_SQR1_SQ1_Pos);
822+
ADC5->SQR1 =
823+
(0 << ADC_SQR1_L_Pos) | // length 1
824+
(1 << ADC_SQR1_SQ1_Pos);
818825

819826
// Sample the ADCs.
820827
ADC1->CR |= ADC_CR_ADSTART;
@@ -845,12 +852,26 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
845852
ADC2->SQR1 =
846853
(0 << ADC_SQR1_L_Pos) | // length 1
847854
(5 << ADC_SQR1_SQ1_Pos);
848-
const auto fet_temp_raw = SampleAdc(ADC2);
855+
ADC5->SQR1 =
856+
(0 << ADC_SQR1_L_Pos) | // length 1
857+
(4 << ADC_SQR1_SQ1_Pos);
858+
859+
ADC2->CR |= ADC_CR_ADSTART;
860+
ADC5->CR |= ADC_CR_ADSTART;
861+
862+
while (((ADC2->ISR & ADC_ISR_EOC) == 0) ||
863+
((ADC5->ISR & ADC_ISR_EOC) == 0));
864+
865+
const auto fet_temp_raw = ADC2->DR;
866+
const auto int_temp_raw = ADC5->DR;
849867

850868
const float fet_temp_C =
851869
((static_cast<float>(fet_temp_raw) / 4096.0f * 3.3f) - 1.8663f) /
852870
-0.01169f;
853871

872+
const float int_temp_C =
873+
(static_cast<float>(int_temp_raw) - ts_cal1_) / static_cast<float>(ts_cal2_ - ts_cal1_) * 100.0f + 30.0f;
874+
854875
if (vsamp_out > 4.0f) {
855876
const float delta_energy_uW_hr = vsamp_in * isamp * 0.001f / 3600.0f * 1e6f;
856877
status_.energy_uW_hr += static_cast<int32_t>(delta_energy_uW_hr);
@@ -860,6 +881,9 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
860881
status_.output_voltage_V = vsamp_out;
861882
status_.output_current_A = isamp;
862883
status_.fet_temp_C = fet_temp_C;
884+
status_.int_temp_raw = int_temp_raw;
885+
status_.int_temp_C = int_temp_C;
886+
863887

864888
isamp_sample_window_[isamp_sample_offset_] = isamp_in;
865889
isamp_sample_offset_ = (isamp_sample_offset_ + 1) % isamp_sample_window_.size();
@@ -1038,6 +1062,11 @@ class PowerDist : public mjlib::multiplex::MicroServer::Server {
10381062
(fw::g_measured_hw_rev <= 2 ? (200.0f / (200.0f + 3000.0f)) :
10391063
(fw::g_measured_hw_rev == 3 ? (200.0f / (200.0f + 4700.0f)) :
10401064
1.0f));
1065+
1066+
const uint16_t* ts_cal1_addr_ = reinterpret_cast<const uint16_t*>(0x1fff75a8);
1067+
const uint16_t* ts_cal2_addr_ = reinterpret_cast<const uint16_t*>(0x1fff75ca);
1068+
const uint16_t ts_cal1_ = *ts_cal1_addr_;
1069+
const uint16_t ts_cal2_ = *ts_cal2_addr_;
10411070
};
10421071

10431072
void RunRev2() {

fw/power_dist_hw.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018-2021 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/stm32g4_flash.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015-2019 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

fw/uuid.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Josh Pieper, jjp@pobox.com.
1+
// Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

tools/bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3 -B
22

3-
# Copyright 2018 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

tools/workspace/bazel_deps/repository.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018-2019 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

tools/workspace/default.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

tools/workspace/github_archive.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

tools/workspace/mjlib/repository.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018-2020 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

tools/workspace/rules_mbed/repository.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- python -*-
22

3-
# Copyright 2018-2019 Josh Pieper, jjp@pobox.com.
3+
# Copyright 2023 mjbots Robotic Systems, LLC. info@mjbots.com
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)