updates
This commit is contained in:
parent
cf028c6c4e
commit
eedbb2a880
Binary file not shown.
|
|
@ -58,6 +58,9 @@
|
|||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>.\Microsoft.DirectX.DirectInput.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Core" />
|
||||
|
|
@ -80,11 +83,11 @@
|
|||
<Reference Include="Windows.Gaming" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Forms\frmDiagnosticos.cs">
|
||||
<Compile Include="Forms\Movimentacao\frmMovDiagnosticos.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmDiagnosticos.Designer.cs">
|
||||
<DependentUpon>frmDiagnosticos.cs</DependentUpon>
|
||||
<Compile Include="Forms\Movimentacao\frmMovDiagnosticos.Designer.cs">
|
||||
<DependentUpon>frmMovDiagnosticos.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmInstancial.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
|
@ -98,17 +101,25 @@
|
|||
<Compile Include="Forms\frmJoystick.Designer.cs">
|
||||
<DependentUpon>frmJoystick.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmPlotMovimentacao.cs">
|
||||
<Compile Include="Forms\Movimentacao\frmMovConfig.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\frmPlotMovimentacao.Designer.cs">
|
||||
<DependentUpon>frmPlotMovimentacao.cs</DependentUpon>
|
||||
<Compile Include="Forms\Movimentacao\frmMovConfig.Designer.cs">
|
||||
<DependentUpon>frmMovConfig.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\DispositivosBaseModel.cs" />
|
||||
<Compile Include="Forms\Movimentacao\frmMovPlot.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\Movimentacao\frmMovPlot.Designer.cs">
|
||||
<DependentUpon>frmMovPlot.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\Modules\DirecionalModel.cs" />
|
||||
<Compile Include="Models\Modules\DispositivosBaseModel.cs" />
|
||||
<Compile Include="Models\Enuns.cs" />
|
||||
<Compile Include="Models\Joystick.cs" />
|
||||
<Compile Include="Models\JoystickGeneric.cs" />
|
||||
<Compile Include="Models\MovimentacaoModel.cs" />
|
||||
<Compile Include="Models\Modules\MovimentacaoModel.cs" />
|
||||
<Compile Include="Models\Modules\PinoutModel.cs" />
|
||||
<Compile Include="Services\DispositivosService.cs" />
|
||||
<Compile Include="Forms\frmPrincipal.cs">
|
||||
<SubType>Form</SubType>
|
||||
|
|
@ -119,11 +130,14 @@
|
|||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\SerialService.cs" />
|
||||
<EmbeddedResource Include="Forms\frmDiagnosticos.resx">
|
||||
<DependentUpon>frmDiagnosticos.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Forms\Movimentacao\frmMovConfig.resx">
|
||||
<DependentUpon>frmMovConfig.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\frmPlotMovimentacao.resx">
|
||||
<DependentUpon>frmPlotMovimentacao.cs</DependentUpon>
|
||||
<EmbeddedResource Include="Forms\Movimentacao\frmMovDiagnosticos.resx">
|
||||
<DependentUpon>frmMovDiagnosticos.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\Movimentacao\frmMovPlot.resx">
|
||||
<DependentUpon>frmMovPlot.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\frmPrincipal.resx">
|
||||
<DependentUpon>frmPrincipal.cs</DependentUpon>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,512 @@
|
|||
|
||||
namespace AgroBase.Forms.Movimentacao
|
||||
{
|
||||
partial class frmMovConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMovConfig));
|
||||
this.imgESP32 = new System.Windows.Forms.PictureBox();
|
||||
this.cmb3v3 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbEN = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO39 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO36 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO33 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO32 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO35 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO34 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO9 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO13 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGND1 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO12 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO14 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO27 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO26 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO25 = new System.Windows.Forms.ComboBox();
|
||||
this.cmb5v = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO11 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO10 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO6 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO7 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO8 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO15 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO2 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO0 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO4 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO16 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO17 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO5 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO18 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO19 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGND3 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO21 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbRX = new System.Windows.Forms.ComboBox();
|
||||
this.cmbTX = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO22 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGPIO23 = new System.Windows.Forms.ComboBox();
|
||||
this.cmbGND2 = new System.Windows.Forms.ComboBox();
|
||||
this.btnSalvar = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// imgESP32
|
||||
//
|
||||
this.imgESP32.Image = ((System.Drawing.Image)(resources.GetObject("imgESP32.Image")));
|
||||
this.imgESP32.Location = new System.Drawing.Point(173, 12);
|
||||
this.imgESP32.Name = "imgESP32";
|
||||
this.imgESP32.Size = new System.Drawing.Size(405, 657);
|
||||
this.imgESP32.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
this.imgESP32.TabIndex = 0;
|
||||
this.imgESP32.TabStop = false;
|
||||
//
|
||||
// cmb3v3
|
||||
//
|
||||
this.cmb3v3.Enabled = false;
|
||||
this.cmb3v3.FormattingEnabled = true;
|
||||
this.cmb3v3.Location = new System.Drawing.Point(18, 53);
|
||||
this.cmb3v3.Name = "cmb3v3";
|
||||
this.cmb3v3.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmb3v3.TabIndex = 1;
|
||||
//
|
||||
// cmbEN
|
||||
//
|
||||
this.cmbEN.Enabled = false;
|
||||
this.cmbEN.FormattingEnabled = true;
|
||||
this.cmbEN.Location = new System.Drawing.Point(18, 83);
|
||||
this.cmbEN.Name = "cmbEN";
|
||||
this.cmbEN.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbEN.TabIndex = 2;
|
||||
//
|
||||
// cmbGPIO39
|
||||
//
|
||||
this.cmbGPIO39.FormattingEnabled = true;
|
||||
this.cmbGPIO39.Location = new System.Drawing.Point(18, 143);
|
||||
this.cmbGPIO39.Name = "cmbGPIO39";
|
||||
this.cmbGPIO39.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO39.TabIndex = 4;
|
||||
//
|
||||
// cmbGPIO36
|
||||
//
|
||||
this.cmbGPIO36.FormattingEnabled = true;
|
||||
this.cmbGPIO36.Location = new System.Drawing.Point(18, 113);
|
||||
this.cmbGPIO36.Name = "cmbGPIO36";
|
||||
this.cmbGPIO36.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO36.TabIndex = 3;
|
||||
//
|
||||
// cmbGPIO33
|
||||
//
|
||||
this.cmbGPIO33.FormattingEnabled = true;
|
||||
this.cmbGPIO33.Location = new System.Drawing.Point(18, 263);
|
||||
this.cmbGPIO33.Name = "cmbGPIO33";
|
||||
this.cmbGPIO33.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO33.TabIndex = 8;
|
||||
//
|
||||
// cmbGPIO32
|
||||
//
|
||||
this.cmbGPIO32.FormattingEnabled = true;
|
||||
this.cmbGPIO32.Location = new System.Drawing.Point(18, 233);
|
||||
this.cmbGPIO32.Name = "cmbGPIO32";
|
||||
this.cmbGPIO32.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO32.TabIndex = 7;
|
||||
//
|
||||
// cmbGPIO35
|
||||
//
|
||||
this.cmbGPIO35.FormattingEnabled = true;
|
||||
this.cmbGPIO35.Location = new System.Drawing.Point(18, 203);
|
||||
this.cmbGPIO35.Name = "cmbGPIO35";
|
||||
this.cmbGPIO35.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO35.TabIndex = 6;
|
||||
//
|
||||
// cmbGPIO34
|
||||
//
|
||||
this.cmbGPIO34.FormattingEnabled = true;
|
||||
this.cmbGPIO34.Location = new System.Drawing.Point(18, 173);
|
||||
this.cmbGPIO34.Name = "cmbGPIO34";
|
||||
this.cmbGPIO34.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO34.TabIndex = 5;
|
||||
//
|
||||
// cmbGPIO9
|
||||
//
|
||||
this.cmbGPIO9.Enabled = false;
|
||||
this.cmbGPIO9.FormattingEnabled = true;
|
||||
this.cmbGPIO9.Location = new System.Drawing.Point(18, 503);
|
||||
this.cmbGPIO9.Name = "cmbGPIO9";
|
||||
this.cmbGPIO9.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO9.TabIndex = 16;
|
||||
//
|
||||
// cmbGPIO13
|
||||
//
|
||||
this.cmbGPIO13.FormattingEnabled = true;
|
||||
this.cmbGPIO13.Location = new System.Drawing.Point(18, 473);
|
||||
this.cmbGPIO13.Name = "cmbGPIO13";
|
||||
this.cmbGPIO13.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO13.TabIndex = 15;
|
||||
//
|
||||
// cmbGND1
|
||||
//
|
||||
this.cmbGND1.Enabled = false;
|
||||
this.cmbGND1.FormattingEnabled = true;
|
||||
this.cmbGND1.Location = new System.Drawing.Point(18, 443);
|
||||
this.cmbGND1.Name = "cmbGND1";
|
||||
this.cmbGND1.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGND1.TabIndex = 14;
|
||||
//
|
||||
// cmbGPIO12
|
||||
//
|
||||
this.cmbGPIO12.FormattingEnabled = true;
|
||||
this.cmbGPIO12.Location = new System.Drawing.Point(18, 413);
|
||||
this.cmbGPIO12.Name = "cmbGPIO12";
|
||||
this.cmbGPIO12.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO12.TabIndex = 13;
|
||||
//
|
||||
// cmbGPIO14
|
||||
//
|
||||
this.cmbGPIO14.FormattingEnabled = true;
|
||||
this.cmbGPIO14.Location = new System.Drawing.Point(18, 383);
|
||||
this.cmbGPIO14.Name = "cmbGPIO14";
|
||||
this.cmbGPIO14.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO14.TabIndex = 12;
|
||||
//
|
||||
// cmbGPIO27
|
||||
//
|
||||
this.cmbGPIO27.FormattingEnabled = true;
|
||||
this.cmbGPIO27.Location = new System.Drawing.Point(18, 353);
|
||||
this.cmbGPIO27.Name = "cmbGPIO27";
|
||||
this.cmbGPIO27.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO27.TabIndex = 11;
|
||||
//
|
||||
// cmbGPIO26
|
||||
//
|
||||
this.cmbGPIO26.FormattingEnabled = true;
|
||||
this.cmbGPIO26.Location = new System.Drawing.Point(18, 323);
|
||||
this.cmbGPIO26.Name = "cmbGPIO26";
|
||||
this.cmbGPIO26.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO26.TabIndex = 10;
|
||||
//
|
||||
// cmbGPIO25
|
||||
//
|
||||
this.cmbGPIO25.FormattingEnabled = true;
|
||||
this.cmbGPIO25.Location = new System.Drawing.Point(18, 293);
|
||||
this.cmbGPIO25.Name = "cmbGPIO25";
|
||||
this.cmbGPIO25.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO25.TabIndex = 9;
|
||||
//
|
||||
// cmb5v
|
||||
//
|
||||
this.cmb5v.Enabled = false;
|
||||
this.cmb5v.FormattingEnabled = true;
|
||||
this.cmb5v.Location = new System.Drawing.Point(18, 593);
|
||||
this.cmb5v.Name = "cmb5v";
|
||||
this.cmb5v.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmb5v.TabIndex = 19;
|
||||
//
|
||||
// cmbGPIO11
|
||||
//
|
||||
this.cmbGPIO11.Enabled = false;
|
||||
this.cmbGPIO11.FormattingEnabled = true;
|
||||
this.cmbGPIO11.Location = new System.Drawing.Point(18, 563);
|
||||
this.cmbGPIO11.Name = "cmbGPIO11";
|
||||
this.cmbGPIO11.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO11.TabIndex = 18;
|
||||
//
|
||||
// cmbGPIO10
|
||||
//
|
||||
this.cmbGPIO10.Enabled = false;
|
||||
this.cmbGPIO10.FormattingEnabled = true;
|
||||
this.cmbGPIO10.Location = new System.Drawing.Point(18, 533);
|
||||
this.cmbGPIO10.Name = "cmbGPIO10";
|
||||
this.cmbGPIO10.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO10.TabIndex = 17;
|
||||
//
|
||||
// cmbGPIO6
|
||||
//
|
||||
this.cmbGPIO6.Enabled = false;
|
||||
this.cmbGPIO6.FormattingEnabled = true;
|
||||
this.cmbGPIO6.Location = new System.Drawing.Point(584, 593);
|
||||
this.cmbGPIO6.Name = "cmbGPIO6";
|
||||
this.cmbGPIO6.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO6.TabIndex = 38;
|
||||
//
|
||||
// cmbGPIO7
|
||||
//
|
||||
this.cmbGPIO7.Enabled = false;
|
||||
this.cmbGPIO7.FormattingEnabled = true;
|
||||
this.cmbGPIO7.Location = new System.Drawing.Point(584, 563);
|
||||
this.cmbGPIO7.Name = "cmbGPIO7";
|
||||
this.cmbGPIO7.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO7.TabIndex = 37;
|
||||
//
|
||||
// cmbGPIO8
|
||||
//
|
||||
this.cmbGPIO8.Enabled = false;
|
||||
this.cmbGPIO8.FormattingEnabled = true;
|
||||
this.cmbGPIO8.Location = new System.Drawing.Point(584, 533);
|
||||
this.cmbGPIO8.Name = "cmbGPIO8";
|
||||
this.cmbGPIO8.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO8.TabIndex = 36;
|
||||
//
|
||||
// cmbGPIO15
|
||||
//
|
||||
this.cmbGPIO15.FormattingEnabled = true;
|
||||
this.cmbGPIO15.Location = new System.Drawing.Point(584, 503);
|
||||
this.cmbGPIO15.Name = "cmbGPIO15";
|
||||
this.cmbGPIO15.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO15.TabIndex = 35;
|
||||
//
|
||||
// cmbGPIO2
|
||||
//
|
||||
this.cmbGPIO2.FormattingEnabled = true;
|
||||
this.cmbGPIO2.Location = new System.Drawing.Point(584, 473);
|
||||
this.cmbGPIO2.Name = "cmbGPIO2";
|
||||
this.cmbGPIO2.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO2.TabIndex = 34;
|
||||
//
|
||||
// cmbGPIO0
|
||||
//
|
||||
this.cmbGPIO0.FormattingEnabled = true;
|
||||
this.cmbGPIO0.Location = new System.Drawing.Point(584, 443);
|
||||
this.cmbGPIO0.Name = "cmbGPIO0";
|
||||
this.cmbGPIO0.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO0.TabIndex = 33;
|
||||
//
|
||||
// cmbGPIO4
|
||||
//
|
||||
this.cmbGPIO4.FormattingEnabled = true;
|
||||
this.cmbGPIO4.Location = new System.Drawing.Point(584, 413);
|
||||
this.cmbGPIO4.Name = "cmbGPIO4";
|
||||
this.cmbGPIO4.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO4.TabIndex = 32;
|
||||
//
|
||||
// cmbGPIO16
|
||||
//
|
||||
this.cmbGPIO16.FormattingEnabled = true;
|
||||
this.cmbGPIO16.Location = new System.Drawing.Point(584, 383);
|
||||
this.cmbGPIO16.Name = "cmbGPIO16";
|
||||
this.cmbGPIO16.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO16.TabIndex = 31;
|
||||
//
|
||||
// cmbGPIO17
|
||||
//
|
||||
this.cmbGPIO17.FormattingEnabled = true;
|
||||
this.cmbGPIO17.Location = new System.Drawing.Point(584, 353);
|
||||
this.cmbGPIO17.Name = "cmbGPIO17";
|
||||
this.cmbGPIO17.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO17.TabIndex = 30;
|
||||
//
|
||||
// cmbGPIO5
|
||||
//
|
||||
this.cmbGPIO5.FormattingEnabled = true;
|
||||
this.cmbGPIO5.Location = new System.Drawing.Point(584, 323);
|
||||
this.cmbGPIO5.Name = "cmbGPIO5";
|
||||
this.cmbGPIO5.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO5.TabIndex = 29;
|
||||
//
|
||||
// cmbGPIO18
|
||||
//
|
||||
this.cmbGPIO18.FormattingEnabled = true;
|
||||
this.cmbGPIO18.Location = new System.Drawing.Point(584, 293);
|
||||
this.cmbGPIO18.Name = "cmbGPIO18";
|
||||
this.cmbGPIO18.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO18.TabIndex = 28;
|
||||
//
|
||||
// cmbGPIO19
|
||||
//
|
||||
this.cmbGPIO19.FormattingEnabled = true;
|
||||
this.cmbGPIO19.Location = new System.Drawing.Point(584, 263);
|
||||
this.cmbGPIO19.Name = "cmbGPIO19";
|
||||
this.cmbGPIO19.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO19.TabIndex = 27;
|
||||
//
|
||||
// cmbGND3
|
||||
//
|
||||
this.cmbGND3.Enabled = false;
|
||||
this.cmbGND3.FormattingEnabled = true;
|
||||
this.cmbGND3.Location = new System.Drawing.Point(584, 233);
|
||||
this.cmbGND3.Name = "cmbGND3";
|
||||
this.cmbGND3.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGND3.TabIndex = 26;
|
||||
//
|
||||
// cmbGPIO21
|
||||
//
|
||||
this.cmbGPIO21.FormattingEnabled = true;
|
||||
this.cmbGPIO21.Location = new System.Drawing.Point(584, 203);
|
||||
this.cmbGPIO21.Name = "cmbGPIO21";
|
||||
this.cmbGPIO21.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO21.TabIndex = 25;
|
||||
//
|
||||
// cmbRX
|
||||
//
|
||||
this.cmbRX.Enabled = false;
|
||||
this.cmbRX.FormattingEnabled = true;
|
||||
this.cmbRX.Location = new System.Drawing.Point(584, 173);
|
||||
this.cmbRX.Name = "cmbRX";
|
||||
this.cmbRX.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbRX.TabIndex = 24;
|
||||
//
|
||||
// cmbTX
|
||||
//
|
||||
this.cmbTX.Enabled = false;
|
||||
this.cmbTX.FormattingEnabled = true;
|
||||
this.cmbTX.Location = new System.Drawing.Point(584, 143);
|
||||
this.cmbTX.Name = "cmbTX";
|
||||
this.cmbTX.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbTX.TabIndex = 23;
|
||||
//
|
||||
// cmbGPIO22
|
||||
//
|
||||
this.cmbGPIO22.FormattingEnabled = true;
|
||||
this.cmbGPIO22.Location = new System.Drawing.Point(584, 113);
|
||||
this.cmbGPIO22.Name = "cmbGPIO22";
|
||||
this.cmbGPIO22.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO22.TabIndex = 22;
|
||||
//
|
||||
// cmbGPIO23
|
||||
//
|
||||
this.cmbGPIO23.FormattingEnabled = true;
|
||||
this.cmbGPIO23.Location = new System.Drawing.Point(584, 83);
|
||||
this.cmbGPIO23.Name = "cmbGPIO23";
|
||||
this.cmbGPIO23.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGPIO23.TabIndex = 21;
|
||||
//
|
||||
// cmbGND2
|
||||
//
|
||||
this.cmbGND2.Enabled = false;
|
||||
this.cmbGND2.FormattingEnabled = true;
|
||||
this.cmbGND2.Location = new System.Drawing.Point(584, 53);
|
||||
this.cmbGND2.Name = "cmbGND2";
|
||||
this.cmbGND2.Size = new System.Drawing.Size(148, 24);
|
||||
this.cmbGND2.TabIndex = 20;
|
||||
//
|
||||
// btnSalvar
|
||||
//
|
||||
this.btnSalvar.Location = new System.Drawing.Point(305, 675);
|
||||
this.btnSalvar.Name = "btnSalvar";
|
||||
this.btnSalvar.Size = new System.Drawing.Size(142, 40);
|
||||
this.btnSalvar.TabIndex = 39;
|
||||
this.btnSalvar.Text = "Salvar";
|
||||
this.btnSalvar.UseVisualStyleBackColor = true;
|
||||
this.btnSalvar.Click += new System.EventHandler(this.btnSalvar_Click);
|
||||
//
|
||||
// frmMovConfig
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.White;
|
||||
this.ClientSize = new System.Drawing.Size(751, 727);
|
||||
this.Controls.Add(this.btnSalvar);
|
||||
this.Controls.Add(this.cmbGPIO6);
|
||||
this.Controls.Add(this.cmbGPIO7);
|
||||
this.Controls.Add(this.cmbGPIO8);
|
||||
this.Controls.Add(this.cmbGPIO15);
|
||||
this.Controls.Add(this.cmbGPIO2);
|
||||
this.Controls.Add(this.cmbGPIO0);
|
||||
this.Controls.Add(this.cmbGPIO4);
|
||||
this.Controls.Add(this.cmbGPIO16);
|
||||
this.Controls.Add(this.cmbGPIO17);
|
||||
this.Controls.Add(this.cmbGPIO5);
|
||||
this.Controls.Add(this.cmbGPIO18);
|
||||
this.Controls.Add(this.cmbGPIO19);
|
||||
this.Controls.Add(this.cmbGND3);
|
||||
this.Controls.Add(this.cmbGPIO21);
|
||||
this.Controls.Add(this.cmbRX);
|
||||
this.Controls.Add(this.cmbTX);
|
||||
this.Controls.Add(this.cmbGPIO22);
|
||||
this.Controls.Add(this.cmbGPIO23);
|
||||
this.Controls.Add(this.cmbGND2);
|
||||
this.Controls.Add(this.cmb5v);
|
||||
this.Controls.Add(this.cmbGPIO11);
|
||||
this.Controls.Add(this.cmbGPIO10);
|
||||
this.Controls.Add(this.cmbGPIO9);
|
||||
this.Controls.Add(this.cmbGPIO13);
|
||||
this.Controls.Add(this.cmbGND1);
|
||||
this.Controls.Add(this.cmbGPIO12);
|
||||
this.Controls.Add(this.cmbGPIO14);
|
||||
this.Controls.Add(this.cmbGPIO27);
|
||||
this.Controls.Add(this.cmbGPIO26);
|
||||
this.Controls.Add(this.cmbGPIO25);
|
||||
this.Controls.Add(this.cmbGPIO33);
|
||||
this.Controls.Add(this.cmbGPIO32);
|
||||
this.Controls.Add(this.cmbGPIO35);
|
||||
this.Controls.Add(this.cmbGPIO34);
|
||||
this.Controls.Add(this.cmbGPIO39);
|
||||
this.Controls.Add(this.cmbGPIO36);
|
||||
this.Controls.Add(this.cmbEN);
|
||||
this.Controls.Add(this.cmb3v3);
|
||||
this.Controls.Add(this.imgESP32);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "frmMovConfig";
|
||||
this.Text = "frmMovConfig";
|
||||
this.Load += new System.EventHandler(this.frmMovConfig_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.imgESP32)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.PictureBox imgESP32;
|
||||
private System.Windows.Forms.ComboBox cmb3v3;
|
||||
private System.Windows.Forms.ComboBox cmbEN;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO39;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO36;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO33;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO32;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO35;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO34;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO9;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO13;
|
||||
private System.Windows.Forms.ComboBox cmbGND1;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO12;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO14;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO27;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO26;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO25;
|
||||
private System.Windows.Forms.ComboBox cmb5v;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO11;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO10;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO6;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO7;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO8;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO15;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO2;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO0;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO4;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO16;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO17;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO5;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO18;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO19;
|
||||
private System.Windows.Forms.ComboBox cmbGND3;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO21;
|
||||
private System.Windows.Forms.ComboBox cmbRX;
|
||||
private System.Windows.Forms.ComboBox cmbTX;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO22;
|
||||
private System.Windows.Forms.ComboBox cmbGPIO23;
|
||||
private System.Windows.Forms.ComboBox cmbGND2;
|
||||
private System.Windows.Forms.Button btnSalvar;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
using AgroBase.Comum;
|
||||
using AgroBase.Models;
|
||||
using AgroBase.Models.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Forms.Movimentacao
|
||||
{
|
||||
public partial class frmMovConfig : Form
|
||||
{
|
||||
DispositivosService Disp = frmPrincipal.Dispositivos.FirstOrDefault(x => x.Dispositivo == T_Code.Mov);
|
||||
|
||||
public frmMovConfig()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmMovConfig_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (Disp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> Pinos = new List<string>()
|
||||
{
|
||||
Enum.GetName(typeof(FuncoesPinout), FuncoesPinout.NaoConectado),
|
||||
};
|
||||
|
||||
MovimentacaoModel.Funcoes.ForEach(x => Pinos.Add(Enum.GetName(typeof(FuncoesPinout), x)));
|
||||
|
||||
foreach (var Motor in ((MovimentacaoModel)(Disp.Dados)).Motores)
|
||||
{
|
||||
Motor.Funcoes.ForEach(x => Pinos.Add(Motor.ID + " " + Enum.GetName(typeof(FuncoesPinout), x)));
|
||||
}
|
||||
|
||||
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Enabled).ToList();
|
||||
foreach (var cmb in cmbs)
|
||||
{
|
||||
cmb.SelectedIndexChanged += Cmb_SelectedIndexChanged;
|
||||
cmb.Items.Clear();
|
||||
Pinos.ForEach(x => cmb.Items.Add(x));
|
||||
int pino = int.Parse(cmb.Name.Replace("cmbGPIO", ""));
|
||||
cmb.SelectedIndex = 0;
|
||||
|
||||
var Selecionado = MovimentacaoModel.Pinout.FirstOrDefault(x => x.Pino == pino);
|
||||
if (Selecionado != null) cmb.SelectedItem = (Selecionado.Funcao != FuncoesPinout.Geral ? Selecionado.ComponenteID + " " : "") + Enum.GetName(typeof(FuncoesPinout), Selecionado.Funcao);
|
||||
}
|
||||
}
|
||||
|
||||
private void Cmb_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var cmb = (ComboBox)sender;
|
||||
this.Controls.OfType<ComboBox>().Where(x => x.Name != cmb.Name && x.SelectedItem != null && x.SelectedItem.ToString() == cmb.SelectedItem.ToString()).ToList().ForEach(x => x.SelectedIndex = 0);
|
||||
}
|
||||
|
||||
private void btnSalvar_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Disp == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MovimentacaoModel.Pinout.ForEach(x =>
|
||||
{
|
||||
x.ComponenteID = "";
|
||||
x.Funcao = FuncoesPinout.NaoConectado;
|
||||
});
|
||||
|
||||
List<ComboBox> cmbs = this.Controls.OfType<ComboBox>().Where(x => x.Enabled).ToList();
|
||||
foreach (var cmb in cmbs)
|
||||
{
|
||||
int pino = int.Parse(cmb.Name.Replace("cmbGPIO", ""));
|
||||
string ComponenteID = cmb.SelectedItem.ToString().Split(' ').Length > 1 ? cmb.SelectedItem.ToString().Split(' ')[0] : "";
|
||||
FuncoesPinout Funcao = (FuncoesPinout)Enum.Parse(typeof(FuncoesPinout), ComponenteID != "" ? (cmb.SelectedItem.ToString().Split(' ')[1]) : cmb.SelectedItem.ToString());
|
||||
MovimentacaoModel.Pinout.FirstOrDefault(x => x.Pino == pino).Funcao = Funcao;
|
||||
MovimentacaoModel.Pinout.FirstOrDefault(x => x.Pino == pino).ComponenteID = ComponenteID;
|
||||
}
|
||||
|
||||
((MovimentacaoModel)(Disp.Dados)).SalvarPinout(MovimentacaoModel.Pinout, "pinout" + Enum.GetName(typeof(T_Code), T_Code.Mov) + ".pin");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
partial class frmDiagnosticos
|
||||
partial class frmMovDiagnosticos
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
|
@ -29,7 +29,7 @@ namespace AgroBase.Forms
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmDiagnosticos));
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMovDiagnosticos));
|
||||
this.imgRobo = new System.Windows.Forms.PictureBox();
|
||||
this.dgvET = new System.Windows.Forms.DataGridView();
|
||||
this.dgvEF = new System.Windows.Forms.DataGridView();
|
||||
|
|
@ -13,7 +13,7 @@ using static AgroBase.Models.Enuns;
|
|||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
public partial class frmDiagnosticos : Form
|
||||
public partial class frmMovDiagnosticos : Form
|
||||
{
|
||||
public static Timer tmrLeitura = new Timer() { Enabled = false, Interval = 500 };
|
||||
public List<DataGridView> Tabelas = new List<DataGridView>();
|
||||
|
|
@ -27,7 +27,7 @@ namespace AgroBase.Forms
|
|||
"Sensor"
|
||||
};
|
||||
|
||||
public frmDiagnosticos()
|
||||
public frmMovDiagnosticos()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
|
@ -90,7 +90,7 @@ namespace AgroBase.Forms
|
|||
|
||||
private void tmrLeitura_Tick(object sender, EventArgs e)
|
||||
{
|
||||
SensoriamentoMotor Motor = ((MovimentacaoModel)DispMov.Dados).Motores.FirstOrDefault(x => x.Conectado && x.Testando);
|
||||
SensoriamentoMotor Motor = ((MovimentacaoModel)DispMov.Dados).Motores.FirstOrDefault(x => x.Comandar && x.Testando);
|
||||
if (Motor != null)
|
||||
{
|
||||
PreencherDadosGrid(Motor);
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
partial class frmPlotMovimentacao
|
||||
partial class frmMovPlot
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
|
|
@ -14,11 +14,11 @@ using static AgroBase.Models.Enuns;
|
|||
|
||||
namespace AgroBase.Forms
|
||||
{
|
||||
public partial class frmPlotMovimentacao : Form
|
||||
public partial class frmMovPlot : Form
|
||||
{
|
||||
private DispositivosService DispMov;
|
||||
|
||||
public frmPlotMovimentacao()
|
||||
public frmMovPlot()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
|
@ -38,35 +38,44 @@ namespace AgroBase.Forms
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach (var Motor in ((MovimentacaoModel)DispMov.Dados).Motores.Where(x => x.Conectado))
|
||||
foreach (var Motor in ((MovimentacaoModel)DispMov.Dados).Motores.Where(x => x.Comandar))
|
||||
{
|
||||
SensorimanetoGrafico Log = null;
|
||||
if (Motor.LogGrafico.Count > 0)
|
||||
{
|
||||
Log = Motor.LogGrafico[Motor.LogGrafico.Count - 1];
|
||||
}
|
||||
|
||||
Chart chart = (Chart)(this.Controls.Find("chart" + Motor.ID, false).First());
|
||||
chart.Titles.Clear();
|
||||
chart.Titles.Add(Motor.Descricao);
|
||||
var Logs = (Motor.LogPID.Count > 60 ? Motor.LogPID.Skip(Math.Max(0, Motor.LogPID.Count - 60)).Take(60).ToList() : Motor.LogPID).Where(log => log.Componente == Motor.ID).ToList();
|
||||
var Logs = (Motor.LogGrafico.Count > 60 ? Motor.LogGrafico.Skip(Math.Max(0, Motor.LogGrafico.Count - 60)).Take(60).ToList() : Motor.LogGrafico).Where(log => log.Componente == Motor.ID).ToList();
|
||||
chart.Series.Clear();
|
||||
List<string> Momentos = Logs.Select(x => x.Momento.ToString("mm:ss:fff")).ToList();
|
||||
var serieRPMsp = new Series("RPM SP");
|
||||
var serieRPMsp = new Series("RPM SP: " + (Log != null ? Log.RPM_SP : 0));
|
||||
serieRPMsp.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_SP).ToList());
|
||||
serieRPMsp.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieRPMsp);
|
||||
var serieRPM = new Series("RPM");
|
||||
var serieRPM = new Series("RPM: " + (Log != null ? Log.RPM : 0));
|
||||
serieRPM.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM).ToList());
|
||||
serieRPM.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieRPM);
|
||||
var seriePotencia = new Series("Potencia");
|
||||
var seriePotencia = new Series("Potencia: " + (Log != null ? Log.Potencia : 0));
|
||||
seriePotencia.Points.DataBindXY(Momentos, Logs.Select(x => x.Potencia).ToList());
|
||||
seriePotencia.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(seriePotencia);
|
||||
var serieTemperatura = new Series("Temperatura: " + (Log != null ? Log.Temperatura : 0));
|
||||
serieTemperatura.Points.DataBindXY(Momentos, Logs.Select(x => x.Temperatura).ToList());
|
||||
serieTemperatura.ChartType = SeriesChartType.Line;
|
||||
chart.Series.Add(serieTemperatura);
|
||||
|
||||
foreach (var legend in chart.Legends)
|
||||
{
|
||||
legend.Docking = Docking.Bottom;
|
||||
}
|
||||
|
||||
if (Motor.LogPID.Count > 0)
|
||||
if (Log != null)
|
||||
{
|
||||
var Log = Motor.LogPID[Motor.LogPID.Count - 1];
|
||||
RichTextBox txtHistorico = (RichTextBox)(this.Controls.Find("txa" + Motor.ID, false).First());
|
||||
txtHistorico.Text += Environment.NewLine +
|
||||
Log.RPM_SP.ToString("0000") +
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using AgroBase.Forms.Movimentacao;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
|
|
@ -14,7 +15,7 @@ namespace AgroBase.Forms
|
|||
{
|
||||
public static frmPrincipal frmPrincipal = new frmPrincipal();
|
||||
public static frmJoystick frmJoystick = new frmJoystick();
|
||||
public static frmPlotMovimentacao frmPlotMovimentacao = new frmPlotMovimentacao();
|
||||
public static frmMovPlot frmPlotMovimentacao = new frmMovPlot();
|
||||
|
||||
public frmInstancial()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,6 +50,19 @@ namespace AgroBase
|
|||
this.lblStripJoystick = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.lblStripJoystickComando = new System.Windows.Forms.ToolStripStatusLabel();
|
||||
this.gpbJoysticks = new System.Windows.Forms.GroupBox();
|
||||
this.lblRampaMax = new System.Windows.Forms.Label();
|
||||
this.lblRampaMin = new System.Windows.Forms.Label();
|
||||
this.nudRampaMax = new System.Windows.Forms.NumericUpDown();
|
||||
this.nudRampaMin = new System.Windows.Forms.NumericUpDown();
|
||||
this.chbMalhaFechada = new System.Windows.Forms.CheckBox();
|
||||
this.lblPID = new System.Windows.Forms.Label();
|
||||
this.btnSalvarPID = new System.Windows.Forms.Button();
|
||||
this.txtKd = new System.Windows.Forms.TextBox();
|
||||
this.lblKd = new System.Windows.Forms.Label();
|
||||
this.txtKi = new System.Windows.Forms.TextBox();
|
||||
this.lblKi = new System.Windows.Forms.Label();
|
||||
this.txtKp = new System.Windows.Forms.TextBox();
|
||||
this.lblKp = new System.Windows.Forms.Label();
|
||||
this.lblRPM = new System.Windows.Forms.Label();
|
||||
this.trkRPM = new System.Windows.Forms.TrackBar();
|
||||
this.lblPrecisao = new System.Windows.Forms.Label();
|
||||
|
|
@ -69,14 +82,7 @@ namespace AgroBase
|
|||
this.btnDiagnosticos = new System.Windows.Forms.Button();
|
||||
this.joystickTimer = new System.Windows.Forms.Timer(this.components);
|
||||
this.btnPlotMov = new System.Windows.Forms.Button();
|
||||
this.lblKp = new System.Windows.Forms.Label();
|
||||
this.txtKp = new System.Windows.Forms.TextBox();
|
||||
this.txtKi = new System.Windows.Forms.TextBox();
|
||||
this.lblKi = new System.Windows.Forms.Label();
|
||||
this.txtKd = new System.Windows.Forms.TextBox();
|
||||
this.lblKd = new System.Windows.Forms.Label();
|
||||
this.btnSalvarPID = new System.Windows.Forms.Button();
|
||||
this.lblPID = new System.Windows.Forms.Label();
|
||||
this.btnMovConfig = new System.Windows.Forms.Button();
|
||||
this.gpbAcoes.SuspendLayout();
|
||||
this.erroStrip.SuspendLayout();
|
||||
this.pnlLateral.SuspendLayout();
|
||||
|
|
@ -84,6 +90,8 @@ namespace AgroBase
|
|||
this.gpbNovoDispositivo.SuspendLayout();
|
||||
this.joystickStrip.SuspendLayout();
|
||||
this.gpbJoysticks.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudRampaMax)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudRampaMin)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trkRPM)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tkbPrecisao)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tkbRampa)).BeginInit();
|
||||
|
|
@ -279,6 +287,11 @@ namespace AgroBase
|
|||
//
|
||||
// gpbJoysticks
|
||||
//
|
||||
this.gpbJoysticks.Controls.Add(this.lblRampaMax);
|
||||
this.gpbJoysticks.Controls.Add(this.lblRampaMin);
|
||||
this.gpbJoysticks.Controls.Add(this.nudRampaMax);
|
||||
this.gpbJoysticks.Controls.Add(this.nudRampaMin);
|
||||
this.gpbJoysticks.Controls.Add(this.chbMalhaFechada);
|
||||
this.gpbJoysticks.Controls.Add(this.lblPID);
|
||||
this.gpbJoysticks.Controls.Add(this.btnSalvarPID);
|
||||
this.gpbJoysticks.Controls.Add(this.txtKd);
|
||||
|
|
@ -306,6 +319,143 @@ namespace AgroBase
|
|||
this.gpbJoysticks.TabStop = false;
|
||||
this.gpbJoysticks.Text = "Controle";
|
||||
//
|
||||
// lblRampaMax
|
||||
//
|
||||
this.lblRampaMax.AutoSize = true;
|
||||
this.lblRampaMax.Location = new System.Drawing.Point(211, 72);
|
||||
this.lblRampaMax.Name = "lblRampaMax";
|
||||
this.lblRampaMax.Size = new System.Drawing.Size(86, 17);
|
||||
this.lblRampaMax.TabIndex = 34;
|
||||
this.lblRampaMax.Text = "Rampa Max:";
|
||||
//
|
||||
// lblRampaMin
|
||||
//
|
||||
this.lblRampaMin.AutoSize = true;
|
||||
this.lblRampaMin.Location = new System.Drawing.Point(12, 70);
|
||||
this.lblRampaMin.Name = "lblRampaMin";
|
||||
this.lblRampaMin.Size = new System.Drawing.Size(83, 17);
|
||||
this.lblRampaMin.TabIndex = 33;
|
||||
this.lblRampaMin.Text = "Rampa Min:";
|
||||
//
|
||||
// nudRampaMax
|
||||
//
|
||||
this.nudRampaMax.Location = new System.Drawing.Point(300, 68);
|
||||
this.nudRampaMax.Maximum = new decimal(new int[] {
|
||||
9999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudRampaMax.Name = "nudRampaMax";
|
||||
this.nudRampaMax.Size = new System.Drawing.Size(66, 22);
|
||||
this.nudRampaMax.TabIndex = 32;
|
||||
this.nudRampaMax.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.nudRampaMax.Value = new decimal(new int[] {
|
||||
1023,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudRampaMax.ValueChanged += new System.EventHandler(this.nudRampaMax_ValueChanged);
|
||||
//
|
||||
// nudRampaMin
|
||||
//
|
||||
this.nudRampaMin.Location = new System.Drawing.Point(120, 68);
|
||||
this.nudRampaMin.Maximum = new decimal(new int[] {
|
||||
9999,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudRampaMin.Name = "nudRampaMin";
|
||||
this.nudRampaMin.Size = new System.Drawing.Size(66, 22);
|
||||
this.nudRampaMin.TabIndex = 31;
|
||||
this.nudRampaMin.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.nudRampaMin.ValueChanged += new System.EventHandler(this.nudRampaMin_ValueChanged);
|
||||
//
|
||||
// chbMalhaFechada
|
||||
//
|
||||
this.chbMalhaFechada.AutoSize = true;
|
||||
this.chbMalhaFechada.Checked = true;
|
||||
this.chbMalhaFechada.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chbMalhaFechada.Location = new System.Drawing.Point(222, 406);
|
||||
this.chbMalhaFechada.Name = "chbMalhaFechada";
|
||||
this.chbMalhaFechada.Size = new System.Drawing.Size(127, 21);
|
||||
this.chbMalhaFechada.TabIndex = 30;
|
||||
this.chbMalhaFechada.Text = "Malha Fechada";
|
||||
this.chbMalhaFechada.UseVisualStyleBackColor = true;
|
||||
this.chbMalhaFechada.CheckedChanged += new System.EventHandler(this.chbMalhaFechada_CheckedChanged);
|
||||
//
|
||||
// lblPID
|
||||
//
|
||||
this.lblPID.AutoSize = true;
|
||||
this.lblPID.Location = new System.Drawing.Point(12, 407);
|
||||
this.lblPID.Name = "lblPID";
|
||||
this.lblPID.Size = new System.Drawing.Size(116, 17);
|
||||
this.lblPID.TabIndex = 29;
|
||||
this.lblPID.Text = "PID - Parâmetros";
|
||||
//
|
||||
// btnSalvarPID
|
||||
//
|
||||
this.btnSalvarPID.Location = new System.Drawing.Point(265, 453);
|
||||
this.btnSalvarPID.Name = "btnSalvarPID";
|
||||
this.btnSalvarPID.Size = new System.Drawing.Size(84, 25);
|
||||
this.btnSalvarPID.TabIndex = 28;
|
||||
this.btnSalvarPID.Text = "Salvar";
|
||||
this.btnSalvarPID.UseVisualStyleBackColor = true;
|
||||
this.btnSalvarPID.Click += new System.EventHandler(this.btnSalvarPID_Click);
|
||||
//
|
||||
// txtKd
|
||||
//
|
||||
this.txtKd.Location = new System.Drawing.Point(182, 454);
|
||||
this.txtKd.Name = "txtKd";
|
||||
this.txtKd.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKd.TabIndex = 27;
|
||||
this.txtKd.Text = "0,005";
|
||||
this.txtKd.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKd
|
||||
//
|
||||
this.lblKd.AutoSize = true;
|
||||
this.lblKd.Location = new System.Drawing.Point(179, 434);
|
||||
this.lblKd.Name = "lblKd";
|
||||
this.lblKd.Size = new System.Drawing.Size(25, 17);
|
||||
this.lblKd.TabIndex = 26;
|
||||
this.lblKd.Text = "Kd";
|
||||
//
|
||||
// txtKi
|
||||
//
|
||||
this.txtKi.Location = new System.Drawing.Point(98, 454);
|
||||
this.txtKi.Name = "txtKi";
|
||||
this.txtKi.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKi.TabIndex = 25;
|
||||
this.txtKi.Text = "0,2";
|
||||
this.txtKi.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKi
|
||||
//
|
||||
this.lblKi.AutoSize = true;
|
||||
this.lblKi.Location = new System.Drawing.Point(95, 434);
|
||||
this.lblKi.Name = "lblKi";
|
||||
this.lblKi.Size = new System.Drawing.Size(20, 17);
|
||||
this.lblKi.TabIndex = 24;
|
||||
this.lblKi.Text = "Ki";
|
||||
//
|
||||
// txtKp
|
||||
//
|
||||
this.txtKp.Location = new System.Drawing.Point(15, 454);
|
||||
this.txtKp.Name = "txtKp";
|
||||
this.txtKp.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKp.TabIndex = 23;
|
||||
this.txtKp.Text = "0,2";
|
||||
this.txtKp.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKp
|
||||
//
|
||||
this.lblKp.AutoSize = true;
|
||||
this.lblKp.Location = new System.Drawing.Point(12, 434);
|
||||
this.lblKp.Name = "lblKp";
|
||||
this.lblKp.Size = new System.Drawing.Size(25, 17);
|
||||
this.lblKp.TabIndex = 22;
|
||||
this.lblKp.Text = "Kp";
|
||||
//
|
||||
// lblRPM
|
||||
//
|
||||
this.lblRPM.AutoSize = true;
|
||||
|
|
@ -318,12 +468,12 @@ namespace AgroBase
|
|||
// trkRPM
|
||||
//
|
||||
this.trkRPM.Location = new System.Drawing.Point(15, 348);
|
||||
this.trkRPM.Maximum = 200;
|
||||
this.trkRPM.Maximum = 500;
|
||||
this.trkRPM.Minimum = 5;
|
||||
this.trkRPM.Name = "trkRPM";
|
||||
this.trkRPM.Size = new System.Drawing.Size(334, 56);
|
||||
this.trkRPM.TabIndex = 20;
|
||||
this.trkRPM.TickFrequency = 5;
|
||||
this.trkRPM.TickFrequency = 10;
|
||||
this.trkRPM.Value = 50;
|
||||
this.trkRPM.Scroll += new System.EventHandler(this.trkRPM_Scroll);
|
||||
//
|
||||
|
|
@ -353,7 +503,7 @@ namespace AgroBase
|
|||
this.tkbRampa.Name = "tkbRampa";
|
||||
this.tkbRampa.Size = new System.Drawing.Size(334, 56);
|
||||
this.tkbRampa.TabIndex = 17;
|
||||
this.tkbRampa.Value = 7;
|
||||
this.tkbRampa.Value = 2;
|
||||
this.tkbRampa.Scroll += new System.EventHandler(this.tkbRampa_Scroll);
|
||||
//
|
||||
// lblRampa
|
||||
|
|
@ -363,32 +513,34 @@ namespace AgroBase
|
|||
this.lblRampa.Name = "lblRampa";
|
||||
this.lblRampa.Size = new System.Drawing.Size(99, 17);
|
||||
this.lblRampa.TabIndex = 16;
|
||||
this.lblRampa.Text = "Rampa: 70 ms";
|
||||
this.lblRampa.Text = "Rampa: 20 ms";
|
||||
//
|
||||
// lblPotencia
|
||||
//
|
||||
this.lblPotencia.AutoSize = true;
|
||||
this.lblPotencia.Location = new System.Drawing.Point(12, 102);
|
||||
this.lblPotencia.Name = "lblPotencia";
|
||||
this.lblPotencia.Size = new System.Drawing.Size(107, 17);
|
||||
this.lblPotencia.Size = new System.Drawing.Size(99, 17);
|
||||
this.lblPotencia.TabIndex = 15;
|
||||
this.lblPotencia.Text = "Potência: 100%";
|
||||
this.lblPotencia.Text = "Potência: 25%";
|
||||
//
|
||||
// tkbPotencia
|
||||
//
|
||||
this.tkbPotencia.Location = new System.Drawing.Point(15, 122);
|
||||
this.tkbPotencia.Minimum = 1;
|
||||
this.tkbPotencia.Maximum = 100;
|
||||
this.tkbPotencia.Minimum = 5;
|
||||
this.tkbPotencia.Name = "tkbPotencia";
|
||||
this.tkbPotencia.Size = new System.Drawing.Size(334, 56);
|
||||
this.tkbPotencia.TabIndex = 14;
|
||||
this.tkbPotencia.Value = 10;
|
||||
this.tkbPotencia.TickFrequency = 5;
|
||||
this.tkbPotencia.Value = 25;
|
||||
this.tkbPotencia.Scroll += new System.EventHandler(this.tkbPotencia_Scroll);
|
||||
//
|
||||
// btnVer
|
||||
//
|
||||
this.btnVer.Location = new System.Drawing.Point(265, 60);
|
||||
this.btnVer.Location = new System.Drawing.Point(300, 29);
|
||||
this.btnVer.Name = "btnVer";
|
||||
this.btnVer.Size = new System.Drawing.Size(84, 25);
|
||||
this.btnVer.Size = new System.Drawing.Size(66, 25);
|
||||
this.btnVer.TabIndex = 13;
|
||||
this.btnVer.Text = "Ver";
|
||||
this.btnVer.UseVisualStyleBackColor = true;
|
||||
|
|
@ -396,7 +548,7 @@ namespace AgroBase
|
|||
//
|
||||
// btnJoyAtt
|
||||
//
|
||||
this.btnJoyAtt.Location = new System.Drawing.Point(175, 29);
|
||||
this.btnJoyAtt.Location = new System.Drawing.Point(120, 29);
|
||||
this.btnJoyAtt.Name = "btnJoyAtt";
|
||||
this.btnJoyAtt.Size = new System.Drawing.Size(84, 25);
|
||||
this.btnJoyAtt.TabIndex = 12;
|
||||
|
|
@ -406,7 +558,7 @@ namespace AgroBase
|
|||
//
|
||||
// btnJoyEdt
|
||||
//
|
||||
this.btnJoyEdt.Location = new System.Drawing.Point(265, 29);
|
||||
this.btnJoyEdt.Location = new System.Drawing.Point(210, 29);
|
||||
this.btnJoyEdt.Name = "btnJoyEdt";
|
||||
this.btnJoyEdt.Size = new System.Drawing.Size(84, 25);
|
||||
this.btnJoyEdt.TabIndex = 11;
|
||||
|
|
@ -420,7 +572,7 @@ namespace AgroBase
|
|||
this.cmbJoysticks.FormattingEnabled = true;
|
||||
this.cmbJoysticks.Location = new System.Drawing.Point(15, 30);
|
||||
this.cmbJoysticks.Name = "cmbJoysticks";
|
||||
this.cmbJoysticks.Size = new System.Drawing.Size(154, 24);
|
||||
this.cmbJoysticks.Size = new System.Drawing.Size(96, 24);
|
||||
this.cmbJoysticks.TabIndex = 3;
|
||||
//
|
||||
// timerDispositivos
|
||||
|
|
@ -488,84 +640,22 @@ namespace AgroBase
|
|||
this.btnPlotMov.UseVisualStyleBackColor = true;
|
||||
this.btnPlotMov.Click += new System.EventHandler(this.btnPlotMov_Click);
|
||||
//
|
||||
// lblKp
|
||||
// btnMovConfig
|
||||
//
|
||||
this.lblKp.AutoSize = true;
|
||||
this.lblKp.Location = new System.Drawing.Point(12, 434);
|
||||
this.lblKp.Name = "lblKp";
|
||||
this.lblKp.Size = new System.Drawing.Size(25, 17);
|
||||
this.lblKp.TabIndex = 22;
|
||||
this.lblKp.Text = "Kp";
|
||||
//
|
||||
// txtKp
|
||||
//
|
||||
this.txtKp.Location = new System.Drawing.Point(15, 454);
|
||||
this.txtKp.Name = "txtKp";
|
||||
this.txtKp.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKp.TabIndex = 23;
|
||||
this.txtKp.Text = "0,2";
|
||||
this.txtKp.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// txtKi
|
||||
//
|
||||
this.txtKi.Location = new System.Drawing.Point(98, 454);
|
||||
this.txtKi.Name = "txtKi";
|
||||
this.txtKi.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKi.TabIndex = 25;
|
||||
this.txtKi.Text = "0,2";
|
||||
this.txtKi.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKi
|
||||
//
|
||||
this.lblKi.AutoSize = true;
|
||||
this.lblKi.Location = new System.Drawing.Point(95, 434);
|
||||
this.lblKi.Name = "lblKi";
|
||||
this.lblKi.Size = new System.Drawing.Size(20, 17);
|
||||
this.lblKi.TabIndex = 24;
|
||||
this.lblKi.Text = "Ki";
|
||||
//
|
||||
// txtKd
|
||||
//
|
||||
this.txtKd.Location = new System.Drawing.Point(182, 454);
|
||||
this.txtKd.Name = "txtKd";
|
||||
this.txtKd.Size = new System.Drawing.Size(60, 22);
|
||||
this.txtKd.TabIndex = 27;
|
||||
this.txtKd.Text = "0,005";
|
||||
this.txtKd.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// lblKd
|
||||
//
|
||||
this.lblKd.AutoSize = true;
|
||||
this.lblKd.Location = new System.Drawing.Point(179, 434);
|
||||
this.lblKd.Name = "lblKd";
|
||||
this.lblKd.Size = new System.Drawing.Size(25, 17);
|
||||
this.lblKd.TabIndex = 26;
|
||||
this.lblKd.Text = "Kd";
|
||||
//
|
||||
// btnSalvarPID
|
||||
//
|
||||
this.btnSalvarPID.Location = new System.Drawing.Point(265, 453);
|
||||
this.btnSalvarPID.Name = "btnSalvarPID";
|
||||
this.btnSalvarPID.Size = new System.Drawing.Size(84, 25);
|
||||
this.btnSalvarPID.TabIndex = 28;
|
||||
this.btnSalvarPID.Text = "Salvar";
|
||||
this.btnSalvarPID.UseVisualStyleBackColor = true;
|
||||
this.btnSalvarPID.Click += new System.EventHandler(this.btnSalvarPID_Click);
|
||||
//
|
||||
// lblPID
|
||||
//
|
||||
this.lblPID.AutoSize = true;
|
||||
this.lblPID.Location = new System.Drawing.Point(12, 407);
|
||||
this.lblPID.Name = "lblPID";
|
||||
this.lblPID.Size = new System.Drawing.Size(116, 17);
|
||||
this.lblPID.TabIndex = 29;
|
||||
this.lblPID.Text = "PID - Parâmetros";
|
||||
this.btnMovConfig.Location = new System.Drawing.Point(390, 103);
|
||||
this.btnMovConfig.Name = "btnMovConfig";
|
||||
this.btnMovConfig.Size = new System.Drawing.Size(112, 25);
|
||||
this.btnMovConfig.TabIndex = 16;
|
||||
this.btnMovConfig.Text = "Config MOV";
|
||||
this.btnMovConfig.UseVisualStyleBackColor = true;
|
||||
this.btnMovConfig.Click += new System.EventHandler(this.btnMovConfig_Click);
|
||||
//
|
||||
// frmPrincipal
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1411, 763);
|
||||
this.Controls.Add(this.btnMovConfig);
|
||||
this.Controls.Add(this.btnPlotMov);
|
||||
this.Controls.Add(this.btnDiagnosticos);
|
||||
this.Controls.Add(this.gpbJoysticks);
|
||||
|
|
@ -590,6 +680,8 @@ namespace AgroBase
|
|||
this.joystickStrip.PerformLayout();
|
||||
this.gpbJoysticks.ResumeLayout(false);
|
||||
this.gpbJoysticks.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudRampaMax)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudRampaMin)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.trkRPM)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tkbPrecisao)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.tkbRampa)).EndInit();
|
||||
|
|
@ -651,6 +743,12 @@ namespace AgroBase
|
|||
private System.Windows.Forms.Label lblKi;
|
||||
private System.Windows.Forms.TextBox txtKp;
|
||||
private System.Windows.Forms.Label lblKp;
|
||||
public System.Windows.Forms.CheckBox chbMalhaFechada;
|
||||
private System.Windows.Forms.Button btnMovConfig;
|
||||
private System.Windows.Forms.Label lblRampaMax;
|
||||
private System.Windows.Forms.Label lblRampaMin;
|
||||
private System.Windows.Forms.NumericUpDown nudRampaMax;
|
||||
private System.Windows.Forms.NumericUpDown nudRampaMin;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using AgroBase.Comum;
|
||||
using AgroBase.Forms;
|
||||
using AgroBase.Forms.Movimentacao;
|
||||
using AgroBase.Models;
|
||||
using AgroBase.Services;
|
||||
using System;
|
||||
|
|
@ -100,7 +101,7 @@ namespace AgroBase
|
|||
|
||||
private void tkbPotencia_Scroll(object sender, EventArgs e)
|
||||
{
|
||||
Joystick.Potencia = tkbPotencia.Value * 10;
|
||||
Joystick.Potencia = tkbPotencia.Value;
|
||||
lblPotencia.Text = "Potência: " + Joystick.Potencia + "%";
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +129,7 @@ namespace AgroBase
|
|||
|
||||
private void btnDiagnosticos_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmDiagnosticos frm = new frmDiagnosticos();
|
||||
frmMovDiagnosticos frm = new frmMovDiagnosticos();
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
|
|
@ -411,5 +412,26 @@ namespace AgroBase
|
|||
MovimentacaoModel.Kd = kd;
|
||||
}
|
||||
}
|
||||
|
||||
private void chbMalhaFechada_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
MovimentacaoModel._FOC = chbMalhaFechada.Checked;
|
||||
}
|
||||
|
||||
private void btnMovConfig_Click(object sender, EventArgs e)
|
||||
{
|
||||
frmMovConfig frm = new frmMovConfig();
|
||||
frm.ShowDialog();
|
||||
}
|
||||
|
||||
private void nudRampaMin_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
MovimentacaoModel.RampaMin = Convert.ToInt32(nudRampaMin.Value);
|
||||
}
|
||||
|
||||
private void nudRampaMax_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
MovimentacaoModel.RampaMax = Convert.ToInt32(nudRampaMax.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 83 KiB |
|
|
@ -77,7 +77,8 @@ namespace AgroBase.Models
|
|||
{
|
||||
sRPM,
|
||||
sTST,
|
||||
sCfg,
|
||||
sCFG,
|
||||
sTMP,
|
||||
}
|
||||
|
||||
public enum BotoesJoystick
|
||||
|
|
|
|||
|
|
@ -17,10 +17,11 @@ namespace AgroBase
|
|||
public static Direcao UltimaDirecao = Direcao.Parado;
|
||||
public static bool Pressionado = false;
|
||||
public static DispositivosService DispMov;
|
||||
public static int Potencia { get; set; } = 100;
|
||||
public static int Rampa { get; set; } = 70;
|
||||
public static int Potencia { get; set; } = 25;
|
||||
public static int Rampa { get; set; } = 20;
|
||||
public static int Precisao { get; set; } = 4;
|
||||
public static int RPM { get; set; } = 50;
|
||||
public static double Angulo { get; set; } = 0;
|
||||
|
||||
public static Timer tmrJoystick = new Timer() { Interval = 100, Enabled = false };
|
||||
public static Gamepad JoystickConectado = null;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,220 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Services;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models.Modules
|
||||
{
|
||||
class DirecionalModel : DispositivosBaseModel
|
||||
{
|
||||
public static int _TaxaAmostragem { get; set; } = 500;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public List<PinoutModel> Pinout { get; set; }
|
||||
public List<SensoriamentoMotor> Motores = new List<SensoriamentoMotor>()
|
||||
{
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 0,
|
||||
ID = "ET",
|
||||
Descricao = "Esquerdo Trás",
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 1,
|
||||
ID = "EF",
|
||||
Descricao = "Esquerdo Frente",
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 2,
|
||||
ID = "DT",
|
||||
Descricao = "Direito Trás",
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 3,
|
||||
ID = "DF",
|
||||
Descricao = "Direito Frente",
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public List<string> ProtocoloConfiguracao(bool Conectar)
|
||||
{
|
||||
List<string> Config = new List<string>();
|
||||
Config.Add(((int)F_Code.Cfg).ToString() +
|
||||
(Conectar ? "1" : "0") + ";" +
|
||||
GetTaxaAmostragem() + ";" +
|
||||
string.Join(";", Motores.OrderBy(x => x.Canal).Select(x => x.Comandar ? "1" : "1").ToArray())
|
||||
);
|
||||
|
||||
return Config;
|
||||
}
|
||||
|
||||
public void RecebeProtocoloSerial(string Protocolo)
|
||||
{
|
||||
// #ET;00000;00000;00000;000
|
||||
if (!string.IsNullOrEmpty(Protocolo) && Protocolo[0].ToString() == SerialService.BeginSensor)
|
||||
{
|
||||
string[] Dados = Protocolo.Replace(SerialService.BeginSensor, "").Split(SerialService.EndLine[0])[0].Split(';');
|
||||
S_Code TipoSensor = (S_Code)(int.Parse(Dados[0]));
|
||||
SensoriamentoMotor Motor = Motores.FirstOrDefault(x => x.ID == Dados[1]);
|
||||
if (Motor == null)
|
||||
{
|
||||
if (Dados[1] == "MD")
|
||||
{
|
||||
Conectado = Dados[2] == "1";
|
||||
}
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
switch (TipoSensor)
|
||||
{
|
||||
case S_Code.sTST:
|
||||
{
|
||||
bool testando = Dados[1] == "1";
|
||||
if (!Motor.Testando && testando)
|
||||
{
|
||||
Motor.LogTestes = new List<SensoriamentoMotorTestes>();
|
||||
}
|
||||
Motor.Testando = testando;
|
||||
if (Motor.Testando && Dados.Length >= 4)
|
||||
{
|
||||
string componente = Dados[2];
|
||||
string resultado = Dados[3];
|
||||
string comando = Dados[4];
|
||||
string leitura = Dados[5];
|
||||
Motor.LogTestes.Add(new SensoriamentoMotorTestes()
|
||||
{
|
||||
Componente = componente,
|
||||
Sucesso = resultado == "SUCESSO",
|
||||
Resultado = resultado,
|
||||
Comando = comando,
|
||||
Leitura = leitura,
|
||||
Momento = DateTime.Now
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case S_Code.sCFG:
|
||||
{
|
||||
Motor.Inicializado = Dados[2] == "1";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public string GetTaxaAmostragem()
|
||||
{
|
||||
return _TaxaAmostragem.ToString("00000");
|
||||
}
|
||||
|
||||
public void SetTaxaAmostragem(int TaxaAmostragem)
|
||||
{
|
||||
_TaxaAmostragem = TaxaAmostragem;
|
||||
}
|
||||
|
||||
public bool GetStatusConexao()
|
||||
{
|
||||
return Conectado;
|
||||
}
|
||||
|
||||
public void PopulaGridSensoriamento()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void AtualizaGridSensoriamento()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao();
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class SensoriamentoMotor : DirecionalModel
|
||||
{
|
||||
public int Canal { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string Descricao { get; set; }
|
||||
public bool Comandar { get; set; } = false;
|
||||
public bool Inicializado { get; set; } = false;
|
||||
public Sentido Sentido { get; set; } = Sentido.Parado;
|
||||
public double Angulo { get; set; } = 0;
|
||||
public bool Testando { get; set; } = false;
|
||||
public List<SensoriamentoMotorTestes> LogTestes { get; set; } = new List<SensoriamentoMotorTestes>();
|
||||
|
||||
|
||||
public string ProtocoloComando(Sentido _Sentido)
|
||||
{
|
||||
if (Comandar)
|
||||
{
|
||||
Angulo = Joystick.Angulo;
|
||||
Sentido = _Sentido;
|
||||
|
||||
string ProtocoloMotor =
|
||||
((int)F_Code.Cmd).ToString() +
|
||||
Canal.ToString("0") + ";" +
|
||||
((int)Sentido).ToString() + ";" +
|
||||
Angulo.ToString("000.00");
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public string ProtocoloTeste()
|
||||
{
|
||||
if (Comandar)
|
||||
{
|
||||
string ProtocoloMotor =
|
||||
((int)F_Code.Tst).ToString() +
|
||||
Canal.ToString("0");
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class SensoriamentoMotorTestes
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Componente { get; set; }
|
||||
public bool Sucesso { get; set; }
|
||||
public string Resultado { get; set; }
|
||||
public string Comando { get; set; }
|
||||
public string Leitura { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using AgroBase.Models.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
|
@ -12,8 +13,10 @@ namespace AgroBase.Models
|
|||
string GetTaxaAmostragem();
|
||||
void SetTaxaAmostragem(int TaxaAmostragem);
|
||||
bool GetStatusConexao();
|
||||
string ProtocoloConfiguracao(bool Conectar);
|
||||
List<string> ProtocoloConfiguracao(bool Conectar);
|
||||
void PopulaGridSensoriamento();
|
||||
void AtualizaGridSensoriamento();
|
||||
List<PinoutModel> CarregarPinout(string nomeArquivo);
|
||||
void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,435 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Models.Modules;
|
||||
using AgroBase.Services;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models
|
||||
{
|
||||
public class MovimentacaoModel : DispositivosBaseModel
|
||||
{
|
||||
public static int _TaxaAmostragem { get; set; } = 500;
|
||||
public static int RampaMin { get; set; } = 0;
|
||||
public static int RampaMax { get; set; } = 1023;
|
||||
public static bool _FOC { get; set; } = true;
|
||||
public static double Kp { get; set; } = 0.2;
|
||||
public static double Ki { get; set; } = 0.2;
|
||||
public static double Kd { get; set; } = 0.005;
|
||||
public double DiametroRoda { get; set; } = 0.3556;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public static List<PinoutModel> Pinout { get; set; }
|
||||
public static List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>();
|
||||
public List<SensoriamentoMotor> Motores = new List<SensoriamentoMotor>()
|
||||
{
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 0,
|
||||
ID = "ET",
|
||||
Descricao = "Esquerdo Trás",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Horario,
|
||||
Tras = Sentido.Antihorario
|
||||
},
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 1,
|
||||
ID = "EF",
|
||||
Descricao = "Esquerdo Frente",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Horario,
|
||||
Tras = Sentido.Antihorario
|
||||
},
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 2,
|
||||
ID = "DT",
|
||||
Descricao = "Direito Trás",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Horario,
|
||||
Tras = Sentido.Antihorario
|
||||
},
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 3,
|
||||
ID = "DF",
|
||||
Descricao = "Direito Frente",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Antihorario,
|
||||
Tras = Sentido.Horario
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
public List<string> ProtocoloConfiguracao(bool Conectar)
|
||||
{
|
||||
List<string> Config = Motores.Select(x => x.ProtocoloConfiguracaoMotor(Conectar)).ToList();
|
||||
string ProtocoloMOD = ((int)F_Code.Cfg).ToString() +
|
||||
"MD" + ";" + // 0 ~ 1
|
||||
(Conectar ? "1" : "0") + ";" + // 3
|
||||
(Pinout.Any(x => x.Funcao == FuncoesPinout.Geral) ? Pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.Geral).Pino.ToString("00") : "-1") + ";" + // 5 ~ 6
|
||||
RampaMin.ToString("0000") + ";" + // 8 ~ 11
|
||||
RampaMax.ToString("0000"); // 13 ~ 16
|
||||
Config.Add(ProtocoloMOD);
|
||||
return Config;
|
||||
}
|
||||
|
||||
public void RecebeProtocoloSerial(string Protocolo)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Protocolo) && Protocolo[0].ToString() == SerialService.BeginSensor)
|
||||
{
|
||||
try
|
||||
{
|
||||
string[] Dados = Protocolo.Replace(SerialService.BeginSensor, "").Split(SerialService.EndLine[0])[0].Split(';');
|
||||
S_Code TipoSensor = (S_Code)(int.Parse(Dados[0]));
|
||||
SensoriamentoMotor Motor = Motores.FirstOrDefault(x => x.ID == Dados[1]);
|
||||
if (Motor == null)
|
||||
{
|
||||
if (Dados[1] == "MD")
|
||||
{
|
||||
Conectado = Dados[2] == "1";
|
||||
}
|
||||
return;
|
||||
}
|
||||
bool AtualizaGrafico = false;
|
||||
try
|
||||
{
|
||||
switch (TipoSensor)
|
||||
{
|
||||
case S_Code.sRPM:
|
||||
{
|
||||
double rpm = 0;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out rpm);
|
||||
Motor.RPM = rpm;
|
||||
double potencia = 0;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out potencia);
|
||||
Motor.Potencia = potencia;
|
||||
long intervalo = 0;
|
||||
long.TryParse(Dados[4].Replace(".", ","), out intervalo);
|
||||
Motor.Intervalo = intervalo;
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
case S_Code.sTST:
|
||||
{
|
||||
bool testando = Dados[2] == "1";
|
||||
if (!Motor.Testando && testando)
|
||||
{
|
||||
Motor.LogTestes = new List<SensoriamentoMotorTestes>();
|
||||
}
|
||||
Motor.Testando = testando;
|
||||
if (Motor.Testando && Dados.Length >= 5)
|
||||
{
|
||||
string componente = Dados[1];
|
||||
string resultado = Dados[2];
|
||||
string comando = Dados[3];
|
||||
string leitura = Dados[4];
|
||||
Motor.LogTestes.Add(new SensoriamentoMotorTestes()
|
||||
{
|
||||
Componente = componente,
|
||||
Sucesso = resultado == "SUCESSO",
|
||||
Resultado = resultado,
|
||||
Comando = comando,
|
||||
Leitura = leitura,
|
||||
Momento = DateTime.Now
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case S_Code.sCFG:
|
||||
{
|
||||
Motor.Inicializado = Dados[2] == "1";
|
||||
break;
|
||||
}
|
||||
case S_Code.sTMP:
|
||||
{
|
||||
double t = 0;
|
||||
double.TryParse(Dados[2].Replace(".", ","), out t);
|
||||
Motor.Temperatura = t;
|
||||
double u = 0;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out u);
|
||||
Motor.Umidade = u;
|
||||
long i = 0;
|
||||
long.TryParse(Dados[4].Replace(".", ","), out i);
|
||||
Motor.IndiceCalor = i;
|
||||
AtualizaGrafico = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
if (AtualizaGrafico)
|
||||
{
|
||||
Motor.LogGrafico.Add(new SensorimanetoGrafico()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
Componente = Motor.ID,
|
||||
RPM_SP = Motor.RPM_SP,
|
||||
RPM = Motor.RPM,
|
||||
Periodo = Motor.Intervalo,
|
||||
Potencia = Motor.Potencia,
|
||||
Kp = Kp,
|
||||
Ki = Ki,
|
||||
Kd = Kd,
|
||||
Temperatura = Motor.Temperatura,
|
||||
Umidade = Motor.Umidade,
|
||||
IndiceCalor = Motor.IndiceCalor,
|
||||
});
|
||||
|
||||
if (Motor.ID == "ET")
|
||||
{
|
||||
Console.WriteLine("RPM: " + Motor.RPM + " - Intervalo: " + Motor.Intervalo + " - RPM Calc: " + (Motor.Intervalo == 0 ? 0 : (2000000 / Motor.Intervalo)));
|
||||
}
|
||||
|
||||
frmInstancial.frmPlotMovimentacao.AtualizaGrafico();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public string GetTaxaAmostragem()
|
||||
{
|
||||
return _TaxaAmostragem.ToString("00000");
|
||||
}
|
||||
|
||||
public void SetTaxaAmostragem(int TaxaAmostragem)
|
||||
{
|
||||
_TaxaAmostragem = TaxaAmostragem;
|
||||
}
|
||||
|
||||
public bool GetStatusConexao()
|
||||
{
|
||||
return Conectado;
|
||||
}
|
||||
|
||||
public void PopulaGridSensoriamento()
|
||||
{
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows.Clear();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Clear();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clMotor", "Motor");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clInicializado", "Inicializado");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clSentido", "Sentido");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clPotencia", "Potencia");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clRPM", "RPM");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clVelocidade", "Velocidade");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clTemperatura", "Temperatura");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clUmidade", "Umidade");
|
||||
foreach (var Motor in Motores)
|
||||
{
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows.Add(new string[]
|
||||
{
|
||||
Motor.Descricao,
|
||||
Motor.Inicializado ? "Sim" : "Não",
|
||||
Enum.GetName(typeof(Sentido), Motor.Sentido),
|
||||
Motor.Potencia.ToString(),
|
||||
Motor.RPM.ToString(),
|
||||
Motor.VelocidadeInstantanea.ToString()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void AtualizaGridSensoriamento()
|
||||
{
|
||||
foreach (var Motor in Motores)
|
||||
{
|
||||
Motor.CalculaVelocidadeInstantanea(DiametroRoda);
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[1].Value = Motor.Inicializado ? "Sim" : "Não";
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[2].Value = Enum.GetName(typeof(Sentido), Motor.Sentido);
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[3].Value = Motor.Potencia.ToString();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[4].Value = Motor.RPM.ToString();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[5].Value = Motor.VelocidadeInstantanea.ToString();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[6].Value = Motor.Temperatura.ToString();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[7].Value = Motor.Umidade.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public List<PinoutModel> CarregarPinout(string nomeArquivo)
|
||||
{
|
||||
if (!File.Exists(nomeArquivo))
|
||||
{
|
||||
var newPinout = PinoutModel.CarregarPinoutPadrao();
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
var pinoutText = File.ReadAllText(nomeArquivo);
|
||||
Pinout = JsonConvert.DeserializeObject<PinoutModel[]>(pinoutText).ToList();
|
||||
return Pinout;
|
||||
}
|
||||
|
||||
public void SalvarPinout(List<PinoutModel> newPinout, string nomeArquivo)
|
||||
{
|
||||
File.WriteAllText(nomeArquivo, JsonConvert.SerializeObject(newPinout));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SensoriamentoMotor
|
||||
{
|
||||
public int Canal { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string Descricao { get; set; }
|
||||
public bool Comandar { get; set; } = false;
|
||||
public bool Inicializado { get; set; } = false;
|
||||
public int RPM_SP { get; set; } = 0;
|
||||
public double Potencia { get; set; } = 0;
|
||||
public int Rampa { get; set; } = 0;
|
||||
public int Precisao { get; set; } = 0;
|
||||
public Sentido Sentido { get; set; } = Sentido.Parado;
|
||||
public double RPM { get; set; } = 0;
|
||||
public long Intervalo { get; set; } = 0;
|
||||
public double VelocidadeInstantanea { get; set; } = 0;
|
||||
public double Temperatura { get; set; } = 0;
|
||||
public double Umidade { get; set; } = 0;
|
||||
public double IndiceCalor { get; set; } = 0;
|
||||
public ConfiguracaoSentidoMotor ConfigSentidos { get; set; }
|
||||
public bool Testando { get; set; } = false;
|
||||
public List<SensoriamentoMotorTestes> LogTestes { get; set; } = new List<SensoriamentoMotorTestes>();
|
||||
public List<SensorimanetoGrafico> LogGrafico { get; set; } = new List<SensorimanetoGrafico>();
|
||||
public List<FuncoesPinout> Funcoes { get; set; } = new List<FuncoesPinout>() {
|
||||
FuncoesPinout.PWM,
|
||||
FuncoesPinout.VEL,
|
||||
FuncoesPinout.DIR,
|
||||
FuncoesPinout.BRK,
|
||||
FuncoesPinout.STP,
|
||||
FuncoesPinout.TMP,
|
||||
};
|
||||
|
||||
public string ProtocoloConfiguracaoMotor(bool Conectar)
|
||||
{
|
||||
var _pinout = MovimentacaoModel.Pinout.Where(x => x.ComponenteID == ID).ToList();
|
||||
return ((int)F_Code.Cfg).ToString() +
|
||||
ID + ";" + // 0 ~ 1
|
||||
(Conectar ? "1" : "0") + ";" + // 3
|
||||
Canal.ToString() + ";" + // 5
|
||||
(MovimentacaoModel._FOC ? "1" : "0") + ";" + // 7
|
||||
MovimentacaoModel._TaxaAmostragem.ToString("00000") + ";" + // 9 ~ 13
|
||||
(Comandar ? "1" : "0") + ";" + // 15
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.PWM) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.PWM).Pino.ToString("00") : "-1") + "," + // 17 ~ 18
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.VEL) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.VEL).Pino.ToString("00") : "-1") + "," + // 20 ~ 21
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.DIR) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.DIR).Pino.ToString("00") : "-1") + "," + // 23 ~ 24
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.BRK) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.BRK).Pino.ToString("00") : "-1") + "," + // 26 ~ 27
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.STP) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.STP).Pino.ToString("00") : "-1") + "," + // 29 ~ 30
|
||||
(_pinout.Any(x => x.Funcao == FuncoesPinout.TMP) ? _pinout.FirstOrDefault(x => x.Funcao == FuncoesPinout.TMP).Pino.ToString("00") : "-1"); // 32 ~ 33
|
||||
|
||||
}
|
||||
|
||||
public string ProtocoloComando(Direcao UltimaDirecao)
|
||||
{
|
||||
if (Comandar)
|
||||
{
|
||||
|
||||
Potencia = Joystick.Potencia;
|
||||
Rampa = Joystick.Rampa;
|
||||
Precisao = Joystick.Precisao;
|
||||
RPM_SP = UltimaDirecao == Direcao.Parado ? 0 : Joystick.RPM;
|
||||
|
||||
switch (UltimaDirecao)
|
||||
{
|
||||
case Direcao.Frente:
|
||||
Sentido = ConfigSentidos.Frente;
|
||||
break;
|
||||
case Direcao.Tras:
|
||||
Sentido = ConfigSentidos.Tras;
|
||||
break;
|
||||
case Direcao.Esquerda:
|
||||
Sentido = ConfigSentidos.Esquerda;
|
||||
break;
|
||||
case Direcao.Direita:
|
||||
Sentido = ConfigSentidos.Direita;
|
||||
break;
|
||||
case Direcao.Parado:
|
||||
default:
|
||||
Sentido = ConfigSentidos.Parado;
|
||||
break;
|
||||
}
|
||||
string ProtocoloMotor =
|
||||
((int)F_Code.Cmd).ToString() +
|
||||
ID + ";" +
|
||||
Potencia.ToString("000") + ";" +
|
||||
((int)Sentido).ToString() + ";" +
|
||||
Rampa.ToString("000") + ";" +
|
||||
Precisao.ToString("000") + ";" +
|
||||
RPM_SP.ToString("000") + ";" +
|
||||
(MovimentacaoModel._FOC ? "1" : "0");
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public string ProtocoloTeste()
|
||||
{
|
||||
if (Comandar)
|
||||
{
|
||||
string ProtocoloMotor =
|
||||
((int)F_Code.Tst).ToString() +
|
||||
ID;
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public void CalculaVelocidadeInstantanea(double Diametro)
|
||||
{
|
||||
VelocidadeInstantanea = Math.Round((Math.PI * Diametro * 60 * RPM) / 1000, 2); // Km/h
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ConfiguracaoSentidoMotor
|
||||
{
|
||||
public Sentido Frente { get; set; }
|
||||
public Sentido Tras { get; set; }
|
||||
public Sentido Esquerda { get; set; }
|
||||
public Sentido Direita { get; set; }
|
||||
public Sentido Parado { get; set; } = Sentido.Parado;
|
||||
}
|
||||
|
||||
public class SensoriamentoMotorTestes
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Componente { get; set; }
|
||||
public bool Sucesso { get; set; }
|
||||
public string Resultado { get; set; }
|
||||
public string Comando { get; set; }
|
||||
public string Leitura { get; set; }
|
||||
}
|
||||
|
||||
public class SensorimanetoGrafico
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Componente { get; set; }
|
||||
public int RPM_SP { get; set; }
|
||||
public double RPM { get; set; }
|
||||
public long Periodo { get; set; }
|
||||
public double Potencia { get; set; }
|
||||
public double Kp { get; set; }
|
||||
public double Ki { get; set; }
|
||||
public double Kd { get; set; }
|
||||
public double Temperatura { get; set; }
|
||||
public double Umidade { get; set; }
|
||||
public double IndiceCalor { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AgroBase.Models.Modules
|
||||
{
|
||||
public class PinoutModel
|
||||
{
|
||||
public int Pino { get; set; }
|
||||
public string Descricao { get; set; }
|
||||
public FuncoesPinout Funcao { get; set; }
|
||||
public bool Habilitado { get; set; }
|
||||
public string ComponenteID { get; set; }
|
||||
|
||||
public static List<PinoutModel> CarregarPinoutPadrao()
|
||||
{
|
||||
List<PinoutModel> Pinout = new List<PinoutModel>()
|
||||
{
|
||||
new PinoutModel() { Pino = 99, ComponenteID = "", Descricao = "3V3", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 98, ComponenteID = "", Descricao = "EN", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 36, ComponenteID = "", Descricao = "GPIO36", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 39, ComponenteID = "", Descricao = "GPIO39", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 34, ComponenteID = "", Descricao = "GPIO34", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 35, ComponenteID = "", Descricao = "GPIO35", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 32, ComponenteID = "", Descricao = "GPIO32", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 33, ComponenteID = "", Descricao = "GPIO33", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 25, ComponenteID = "", Descricao = "GPIO25", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 26, ComponenteID = "", Descricao = "GPIO26", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 27, ComponenteID = "", Descricao = "GPIO27", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 14, ComponenteID = "", Descricao = "GPIO14", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 12, ComponenteID = "", Descricao = "GPIO12", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 97, ComponenteID = "", Descricao = "GND", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 13, ComponenteID = "", Descricao = "GPIO13", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 09, ComponenteID = "", Descricao = "GPIO09", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 10, ComponenteID = "", Descricao = "GPIO10", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 11, ComponenteID = "", Descricao = "GPIO11", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 96, ComponenteID = "", Descricao = "5V", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 95, ComponenteID = "", Descricao = "GND", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 23, ComponenteID = "", Descricao = "GPIO23", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 22, ComponenteID = "", Descricao = "GPIO22", Funcao = FuncoesPinout.Desabilitado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 01, ComponenteID = "", Descricao = "GPIO01", Funcao = FuncoesPinout.TX, Habilitado = false },
|
||||
new PinoutModel() { Pino = 03, ComponenteID = "", Descricao = "GPIO03", Funcao = FuncoesPinout.RX, Habilitado = false },
|
||||
new PinoutModel() { Pino = 21, ComponenteID = "", Descricao = "GPIO21", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 94, ComponenteID = "", Descricao = "GND", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 19, ComponenteID = "", Descricao = "GPIO19", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 18, ComponenteID = "", Descricao = "GPIO18", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 05, ComponenteID = "", Descricao = "GPIO05", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 17, ComponenteID = "", Descricao = "GPIO17", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 16, ComponenteID = "", Descricao = "GPIO16", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 04, ComponenteID = "", Descricao = "GPIO04", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 00, ComponenteID = "", Descricao = "GPIO00", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 02, ComponenteID = "", Descricao = "GPIO02", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 15, ComponenteID = "", Descricao = "GPIO15", Funcao = FuncoesPinout.NaoConectado, Habilitado = true },
|
||||
new PinoutModel() { Pino = 08, ComponenteID = "", Descricao = "GPIO08", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 07, ComponenteID = "", Descricao = "GPIO07", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
new PinoutModel() { Pino = 06, ComponenteID = "", Descricao = "GPIO06", Funcao = FuncoesPinout.Desabilitado, Habilitado = false },
|
||||
};
|
||||
|
||||
return Pinout;
|
||||
}
|
||||
}
|
||||
|
||||
public enum FuncoesPinout
|
||||
{
|
||||
NaoConectado,
|
||||
Desabilitado,
|
||||
TX,
|
||||
RX,
|
||||
Geral,
|
||||
PWM,
|
||||
VEL,
|
||||
DIR,
|
||||
BRK,
|
||||
STP,
|
||||
TMP,
|
||||
}
|
||||
}
|
||||
|
|
@ -1,343 +0,0 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Models
|
||||
{
|
||||
public class MovimentacaoModel : DispositivosBaseModel
|
||||
{
|
||||
public int _TaxaAmostragem { get; set; }
|
||||
public static double Kp { get; set; } = 0.2;
|
||||
public static double Ki { get; set; } = 0.2;
|
||||
public static double Kd { get; set; } = 0.005;
|
||||
public double DiametroRoda { get; set; } = 0.3556;
|
||||
public bool Conectado { get; set; } = false;
|
||||
public List<SensoriamentoMotor> Motores = new List<SensoriamentoMotor>()
|
||||
{
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 0,
|
||||
ID = "ET",
|
||||
Descricao = "Esquerdo Trás",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Horario,
|
||||
Tras = Sentido.Antihorario
|
||||
}
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 1,
|
||||
ID = "EF",
|
||||
Descricao = "Esquerdo Frente",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Horario,
|
||||
Tras = Sentido.Antihorario
|
||||
}
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 2,
|
||||
ID = "DT",
|
||||
Descricao = "Direito Trás",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Antihorario,
|
||||
Tras = Sentido.Horario
|
||||
}
|
||||
},
|
||||
new SensoriamentoMotor() {
|
||||
Canal = 3,
|
||||
ID = "DF",
|
||||
Descricao = "Direito Frente",
|
||||
ConfigSentidos = new ConfiguracaoSentidoMotor() {
|
||||
Direita = Sentido.Antihorario,
|
||||
Esquerda = Sentido.Horario,
|
||||
Frente = Sentido.Antihorario,
|
||||
Tras = Sentido.Horario
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public string ProtocoloConfiguracao(bool Conectar)
|
||||
{
|
||||
return ((int)F_Code.Cfg).ToString() +
|
||||
(Conectar ? "1" : "0") + ";" +
|
||||
GetTaxaAmostragem() + ";" +
|
||||
string.Join(";", Motores.OrderBy(x => x.Canal).Select(x => x.Conectado ? "1" : "1").ToArray()) + ";" +
|
||||
Kp.ToString("0.000").Replace(",", ".") + ";" +
|
||||
Ki.ToString("0.000").Replace(",", ".") + ";" +
|
||||
Kd.ToString("0.000").Replace(",", ".");
|
||||
}
|
||||
|
||||
public void RecebeProtocoloSerial(string Protocolo)
|
||||
{
|
||||
// #ET;00000;00000;00000;000
|
||||
if (!string.IsNullOrEmpty(Protocolo) && Protocolo[0].ToString() == SerialService.BeginSensor)
|
||||
{
|
||||
S_Code TipoSensor = (S_Code)(int.Parse(Protocolo[1].ToString()));
|
||||
string[] Dados = Protocolo.Substring(2, Protocolo.Length - 3).Split(';');
|
||||
SensoriamentoMotor Motor = Motores.FirstOrDefault(x => x.ID == Dados[0]);
|
||||
if (Motor == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
try
|
||||
{
|
||||
switch (TipoSensor)
|
||||
{
|
||||
case S_Code.sRPM:
|
||||
{
|
||||
int nPulsos = 0;
|
||||
int.TryParse(Dados[1], out nPulsos);
|
||||
Motor.NumeroPulsos = nPulsos;
|
||||
int intervalo = 0;
|
||||
int.TryParse(Dados[2], out intervalo);
|
||||
Motor.Intervalo = intervalo;
|
||||
double rpm = 0;
|
||||
double.TryParse(Dados[3].Replace(".", ","), out rpm);
|
||||
Motor.RPM = rpm;
|
||||
double potencia = 0;
|
||||
double.TryParse(Dados[4].Replace(".", ","), out potencia);
|
||||
Motor.Potencia = potencia;
|
||||
|
||||
Motor.LogPID.Add(new SensorimanetoPID()
|
||||
{
|
||||
Momento = DateTime.Now,
|
||||
Componente = Dados[0],
|
||||
RPM_SP = Motor.RPM_SP,
|
||||
RPM = Motor.RPM,
|
||||
Potencia = Motor.Potencia,
|
||||
Kp = Kp,
|
||||
Ki = Ki,
|
||||
Kd = Kd,
|
||||
});
|
||||
|
||||
frmInstancial.frmPlotMovimentacao.AtualizaGrafico();
|
||||
break;
|
||||
}
|
||||
case S_Code.sTST:
|
||||
{
|
||||
bool testando = Dados[1] == "1";
|
||||
if (!Motor.Testando && testando)
|
||||
{
|
||||
Motor.LogTestes = new List<SensoriamentoMotorTestes>();
|
||||
}
|
||||
Motor.Testando = testando;
|
||||
if (Motor.Testando && Dados.Length >= 4)
|
||||
{
|
||||
string componente = Dados[2];
|
||||
string resultado = Dados[3];
|
||||
string comando = Dados[4];
|
||||
string leitura = Dados[5];
|
||||
Motor.LogTestes.Add(new SensoriamentoMotorTestes()
|
||||
{
|
||||
Componente = componente,
|
||||
Sucesso = resultado == "SUCESSO",
|
||||
Resultado = resultado,
|
||||
Comando = comando,
|
||||
Leitura = leitura,
|
||||
Momento = DateTime.Now
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case S_Code.sCfg:
|
||||
{
|
||||
Conectado = Dados[1] == "1";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public string GetTaxaAmostragem()
|
||||
{
|
||||
return _TaxaAmostragem.ToString("00000");
|
||||
}
|
||||
|
||||
public void SetTaxaAmostragem(int TaxaAmostragem)
|
||||
{
|
||||
_TaxaAmostragem = TaxaAmostragem;
|
||||
}
|
||||
|
||||
public bool GetStatusConexao()
|
||||
{
|
||||
return Conectado;
|
||||
}
|
||||
|
||||
public void PopulaGridSensoriamento()
|
||||
{
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows.Clear();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Clear();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clMotor", "Motor");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clInicializado", "Inicializado");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clSentido", "Sentido");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clPotencia", "Potencia");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clRPM", "RPM");
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Columns.Add("clVelocidade", "Velocidade");
|
||||
foreach (var Motor in Motores)
|
||||
{
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows.Add(new string[]
|
||||
{
|
||||
Motor.Descricao,
|
||||
Motor.Inicializado ? "Sim" : "Não",
|
||||
Enum.GetName(typeof(Sentido), Motor.Sentido),
|
||||
Motor.Potencia.ToString(),
|
||||
Motor.RPM.ToString(),
|
||||
Motor.VelocidadeInstantanea.ToString()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void AtualizaGridSensoriamento()
|
||||
{
|
||||
double RPM_Medio = Motores.Average(x => x.RPM);
|
||||
|
||||
foreach (var Motor in Motores)
|
||||
{
|
||||
Motor.CalculaVelocidadeInstantanea(DiametroRoda);
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[1].Value = Motor.Inicializado ? "Sim" : "Não";
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[2].Value = Enum.GetName(typeof(Sentido), Motor.Sentido);
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[3].Value = Motor.Potencia.ToString();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[4].Value = Motor.RPM.ToString();
|
||||
frmInstancial.frmPrincipal.gridSenMotores.Rows[Motor.Canal].Cells[5].Value = Motor.VelocidadeInstantanea.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class SensoriamentoMotor
|
||||
{
|
||||
public int Canal { get; set; }
|
||||
public string ID { get; set; }
|
||||
public string Descricao { get; set; }
|
||||
public bool Conectado { get; set; }
|
||||
public bool Inicializado { get; set; }
|
||||
public int RPM_SP { get; set; } = 0;
|
||||
public double Potencia { get; set; } = 0;
|
||||
public int Rampa { get; set; } = 0;
|
||||
public int Precisao { get; set; } = 0;
|
||||
public Sentido Sentido { get; set; }
|
||||
public int NumeroPulsos { get; set; } = 0;
|
||||
public int Intervalo { get; set; } = 0;
|
||||
public double RPM { get; set; } = 0;
|
||||
public double VelocidadeInstantanea { get; set; } = 0;
|
||||
public ConfiguracaoSentidoMotor ConfigSentidos { get; set; }
|
||||
public bool Testando { get; set; } = false;
|
||||
public List<SensoriamentoMotorTestes> LogTestes { get; set; } = new List<SensoriamentoMotorTestes>();
|
||||
public List<SensorimanetoPID> LogPID { get; set; } = new List<SensorimanetoPID>();
|
||||
|
||||
|
||||
public string ProtocoloComando(Direcao UltimaDirecao)
|
||||
{
|
||||
if (Conectado)
|
||||
{
|
||||
|
||||
Potencia = Joystick.Potencia;
|
||||
Rampa = Joystick.Rampa;
|
||||
Precisao = Joystick.Precisao;
|
||||
RPM_SP = UltimaDirecao == Direcao.Parado ? 0 : Joystick.RPM;
|
||||
|
||||
switch (UltimaDirecao)
|
||||
{
|
||||
case Direcao.Frente:
|
||||
Sentido = ConfigSentidos.Frente;
|
||||
break;
|
||||
case Direcao.Tras:
|
||||
Sentido = ConfigSentidos.Tras;
|
||||
break;
|
||||
case Direcao.Esquerda:
|
||||
Sentido = ConfigSentidos.Esquerda;
|
||||
break;
|
||||
case Direcao.Direita:
|
||||
Sentido = ConfigSentidos.Direita;
|
||||
break;
|
||||
case Direcao.Parado:
|
||||
default:
|
||||
Sentido = ConfigSentidos.Parado;
|
||||
break;
|
||||
}
|
||||
string ProtocoloMotor =
|
||||
((int)F_Code.Cmd).ToString() +
|
||||
Canal.ToString("0") + ";" +
|
||||
Potencia.ToString("000") + ";" +
|
||||
((int)Sentido).ToString() + ";" +
|
||||
Rampa.ToString("000") + ";" +
|
||||
Precisao.ToString("000") + ";" +
|
||||
RPM_SP.ToString("000") + ";" +
|
||||
MovimentacaoModel.Kp.ToString("0.000").Replace(",", ".") + ";" +
|
||||
MovimentacaoModel.Ki.ToString("0.000").Replace(",", ".") + ";" +
|
||||
MovimentacaoModel.Kd.ToString("0.000").Replace(",", ".");
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public string ProtocoloTeste()
|
||||
{
|
||||
if (Conectado)
|
||||
{
|
||||
string ProtocoloMotor =
|
||||
((int)F_Code.Tst).ToString() +
|
||||
Canal.ToString("0");
|
||||
return ProtocoloMotor;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
public void CalculaVelocidadeInstantanea(double Diametro)
|
||||
{
|
||||
VelocidadeInstantanea = (Math.PI * Diametro * 60 * RPM) / 1000; // Km/h
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ConfiguracaoSentidoMotor
|
||||
{
|
||||
public Sentido Frente { get; set; }
|
||||
public Sentido Tras { get; set; }
|
||||
public Sentido Esquerda { get; set; }
|
||||
public Sentido Direita { get; set; }
|
||||
public Sentido Parado { get; set; } = Sentido.Parado;
|
||||
}
|
||||
|
||||
public class SensoriamentoMotorTestes
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Componente { get; set; }
|
||||
public bool Sucesso { get; set; }
|
||||
public string Resultado { get; set; }
|
||||
public string Comando { get; set; }
|
||||
public string Leitura { get; set; }
|
||||
}
|
||||
|
||||
public class SensorimanetoPID
|
||||
{
|
||||
public DateTime Momento { get; set; }
|
||||
public string Componente { get; set; }
|
||||
public int RPM_SP { get; set; }
|
||||
public double RPM { get; set; }
|
||||
public double Potencia { get; set; }
|
||||
public double Kp { get; set; }
|
||||
public double Ki { get; set; }
|
||||
public double Kd { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
using AgroBase.Forms;
|
||||
using AgroBase.Models;
|
||||
using AgroBase.Models.Modules;
|
||||
using AgroBase.Services;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -112,6 +113,9 @@ namespace AgroBase.Comum
|
|||
|
||||
_Porta.Open();
|
||||
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
|
||||
lblStatus.Text = StatusPorta();
|
||||
|
||||
return _Porta.IsOpen;
|
||||
|
|
@ -132,6 +136,9 @@ namespace AgroBase.Comum
|
|||
return false;
|
||||
}
|
||||
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
|
||||
_Porta.Close();
|
||||
|
||||
lblStatus.Text = StatusPorta();
|
||||
|
|
@ -163,14 +170,21 @@ namespace AgroBase.Comum
|
|||
{
|
||||
case T_Code.Mov:
|
||||
Dados = new MovimentacaoModel();
|
||||
((MovimentacaoModel)Dados)._TaxaAmostragem = 2000;
|
||||
Dados.PopulaGridSensoriamento();
|
||||
break;
|
||||
case T_Code.Dir:
|
||||
Dados = new DirecionalModel();
|
||||
break;
|
||||
default:
|
||||
Dados = default(DispositivosBaseModel);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Dados != default(DispositivosBaseModel))
|
||||
{
|
||||
Dados.PopulaGridSensoriamento();
|
||||
Dados.CarregarPinout("pinout" + Enum.GetName(typeof(T_Code), Dispositivo) + ".pin");
|
||||
}
|
||||
|
||||
_Porta.DataReceived -= _Porta_DataReceived;
|
||||
_Porta.DataReceived += _Porta_DataReceived;
|
||||
|
||||
|
|
@ -271,7 +285,16 @@ namespace AgroBase.Comum
|
|||
if (SerialService.DispositivosMotores.Contains(Dispositivo))
|
||||
{
|
||||
clbMotores.Items.Clear();
|
||||
clbMotores.Items.AddRange(((MovimentacaoModel)Dados).Motores.Select(x => x.ID).ToArray());
|
||||
string[] Motores = { };
|
||||
if (Dispositivo == T_Code.Mov)
|
||||
{
|
||||
Motores = ((MovimentacaoModel)Dados).Motores.Select(x => x.ID).ToArray();
|
||||
}
|
||||
else if (Dispositivo == T_Code.Dir)
|
||||
{
|
||||
Motores = ((DirecionalModel)Dados).Motores.Select(x => x.ID).ToArray();
|
||||
}
|
||||
clbMotores.Items.AddRange(Motores);
|
||||
}
|
||||
clbMotores.ItemCheck += clbMotores_ItemCheck;
|
||||
|
||||
|
|
@ -357,15 +380,16 @@ namespace AgroBase.Comum
|
|||
switch (Dispositivo)
|
||||
{
|
||||
case T_Code.Mov:
|
||||
((MovimentacaoModel)Dados).Motores.ForEach(x => x.Conectado = false);
|
||||
((MovimentacaoModel)Dados).Motores.ForEach(x => x.Comandar = false);
|
||||
foreach (var Item in ((CheckedListBox)sender).CheckedItems)
|
||||
{
|
||||
((MovimentacaoModel)Dados).Motores.First(x => x.ID == Item.ToString()).Conectado = true;
|
||||
((MovimentacaoModel)Dados).Motores.First(x => x.ID == Item.ToString()).Comandar = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
frmInstancial.frmPrincipal.lblStripErro.Text = Dados.ProtocoloConfiguracao(true);
|
||||
var Config = Dados.ProtocoloConfiguracao(true);
|
||||
frmInstancial.frmPrincipal.lblStripErro.Text = Config[Config.Count - 1];
|
||||
}
|
||||
|
||||
private void nudAmostragem_ValueChanged(object sender, EventArgs e)
|
||||
|
|
@ -376,6 +400,11 @@ namespace AgroBase.Comum
|
|||
private void btnLimpar_Click(object sender, EventArgs e)
|
||||
{
|
||||
txaConsole.Text = "";
|
||||
if (_Porta.IsOpen)
|
||||
{
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
private void txtEnvios_KeyDown(object sender, KeyEventArgs e)
|
||||
|
|
@ -396,7 +425,20 @@ namespace AgroBase.Comum
|
|||
|
||||
private void _Porta_DataReceived(object sender, SerialDataReceivedEventArgs e)
|
||||
{
|
||||
string Recebido = _Porta.ReadLine();
|
||||
string Recebido = "";
|
||||
try
|
||||
{
|
||||
Recebido = _Porta.ReadLine();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
if (Recebido == "")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Dispositivo == T_Code.Vzo)
|
||||
{
|
||||
Dispositivo = (T_Code)(int.Parse(Recebido.Substring(0, 3)));
|
||||
|
|
@ -407,39 +449,47 @@ namespace AgroBase.Comum
|
|||
|
||||
if (Recebido[0].ToString() == SerialService.BeginSensor && Dados != default(DispositivosBaseModel))
|
||||
{
|
||||
switch (Dispositivo)
|
||||
{
|
||||
case T_Code.Mov:
|
||||
Dados.RecebeProtocoloSerial(Recebido);
|
||||
Dados.AtualizaGridSensoriamento();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Dados.RecebeProtocoloSerial(Recebido);
|
||||
Dados.AtualizaGridSensoriamento();
|
||||
}
|
||||
}
|
||||
|
||||
private void btnConectar_Click(object sender, EventArgs e)
|
||||
{
|
||||
string ProtocoloConfiguracao = "";
|
||||
List<string> Config = new List<string>();
|
||||
|
||||
if (_Porta.IsOpen)
|
||||
{
|
||||
ProtocoloConfiguracao = Dados.ProtocoloConfiguracao(false);
|
||||
if (ProtocoloConfiguracao != "")
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
|
||||
Config = Dados.ProtocoloConfiguracao(false);
|
||||
foreach (var ProtocoloConfiguracao in Config)
|
||||
{
|
||||
EnviarDadosSerial(ProtocoloConfiguracao);
|
||||
if (ProtocoloConfiguracao != "")
|
||||
{
|
||||
EnviarDadosSerial(ProtocoloConfiguracao);
|
||||
Task.Delay(100);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ConectarPortaSerial())
|
||||
{
|
||||
ProtocoloConfiguracao = Dados.ProtocoloConfiguracao(true);
|
||||
if (ProtocoloConfiguracao != "")
|
||||
_Porta.DiscardInBuffer();
|
||||
_Porta.DiscardOutBuffer();
|
||||
|
||||
Config = Dados.ProtocoloConfiguracao(true);
|
||||
foreach (var ProtocoloConfiguracao in Config)
|
||||
{
|
||||
EnviarDadosSerial(ProtocoloConfiguracao);
|
||||
if (ProtocoloConfiguracao != "")
|
||||
{
|
||||
EnviarDadosSerial(ProtocoloConfiguracao);
|
||||
Task.Delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
tmrConexao.Enabled = true;
|
||||
|
|
|
|||
|
|
@ -2,9 +2,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static AgroBase.Models.Enuns;
|
||||
|
||||
namespace AgroBase.Services
|
||||
|
|
@ -56,14 +53,15 @@ namespace AgroBase.Services
|
|||
string Recebido = Porta.ReadLine();
|
||||
if (Recebido.Length > 2)
|
||||
{
|
||||
var Dados = Recebido.Split(';');
|
||||
int code = 0;
|
||||
int.TryParse(Recebido.Substring(0, 3), out code);
|
||||
int.TryParse(Dados[0], out code);
|
||||
if (code == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
T_Code Dispositivo = (T_Code)(int.Parse(Recebido.Substring(0, 3)));
|
||||
T_Code Dispositivo = (T_Code)(int.Parse(Dados[0]));
|
||||
DispositivosConectados.Add(new DispositivoDetalhesModel()
|
||||
{
|
||||
PortaCOM = Porta.PortName,
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1 @@
|
|||
[{"Pino":99,"Descricao":"3V3","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":98,"Descricao":"EN","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":36,"Descricao":"GPIO36","Funcao":6,"Habilitado":true,"ComponenteID":"DT"},{"Pino":39,"Descricao":"GPIO39","Funcao":6,"Habilitado":true,"ComponenteID":"DF"},{"Pino":34,"Descricao":"GPIO34","Funcao":6,"Habilitado":true,"ComponenteID":"EF"},{"Pino":35,"Descricao":"GPIO35","Funcao":6,"Habilitado":true,"ComponenteID":"ET"},{"Pino":32,"Descricao":"GPIO32","Funcao":9,"Habilitado":true,"ComponenteID":"EF"},{"Pino":33,"Descricao":"GPIO33","Funcao":8,"Habilitado":true,"ComponenteID":"EF"},{"Pino":25,"Descricao":"GPIO25","Funcao":7,"Habilitado":true,"ComponenteID":"EF"},{"Pino":26,"Descricao":"GPIO26","Funcao":10,"Habilitado":true,"ComponenteID":"DT"},{"Pino":27,"Descricao":"GPIO27","Funcao":9,"Habilitado":true,"ComponenteID":"ET"},{"Pino":14,"Descricao":"GPIO14","Funcao":8,"Habilitado":true,"ComponenteID":"ET"},{"Pino":12,"Descricao":"GPIO12","Funcao":7,"Habilitado":true,"ComponenteID":"ET"},{"Pino":97,"Descricao":"GND","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":13,"Descricao":"GPIO13","Funcao":5,"Habilitado":true,"ComponenteID":"EF"},{"Pino":9,"Descricao":"GPIO09","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":10,"Descricao":"GPIO10","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":11,"Descricao":"GPIO11","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":96,"Descricao":"5V","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":95,"Descricao":"GND","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":23,"Descricao":"GPIO23","Funcao":5,"Habilitado":true,"ComponenteID":"ET"},{"Pino":22,"Descricao":"GPIO22","Funcao":10,"Habilitado":true,"ComponenteID":"EF"},{"Pino":1,"Descricao":"GPIO01","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":3,"Descricao":"GPIO03","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":21,"Descricao":"GPIO21","Funcao":10,"Habilitado":true,"ComponenteID":"DF"},{"Pino":94,"Descricao":"GND","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":19,"Descricao":"GPIO19","Funcao":9,"Habilitado":true,"ComponenteID":"DF"},{"Pino":18,"Descricao":"GPIO18","Funcao":8,"Habilitado":true,"ComponenteID":"DF"},{"Pino":5,"Descricao":"GPIO05","Funcao":7,"Habilitado":true,"ComponenteID":"DF"},{"Pino":17,"Descricao":"GPIO17","Funcao":5,"Habilitado":true,"ComponenteID":"DF"},{"Pino":16,"Descricao":"GPIO16","Funcao":10,"Habilitado":true,"ComponenteID":"ET"},{"Pino":4,"Descricao":"GPIO04","Funcao":9,"Habilitado":true,"ComponenteID":"DT"},{"Pino":0,"Descricao":"GPIO00","Funcao":8,"Habilitado":true,"ComponenteID":"DT"},{"Pino":2,"Descricao":"GPIO02","Funcao":7,"Habilitado":true,"ComponenteID":"DT"},{"Pino":15,"Descricao":"GPIO15","Funcao":5,"Habilitado":true,"ComponenteID":"DT"},{"Pino":8,"Descricao":"GPIO08","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":7,"Descricao":"GPIO07","Funcao":0,"Habilitado":false,"ComponenteID":""},{"Pino":6,"Descricao":"GPIO06","Funcao":0,"Habilitado":false,"ComponenteID":""}]
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
b4f57dddbf750ed782de6ee72b86251665a4eb9c
|
||||
da9cb9d537249dad407d2f15902a88a82a63c91e
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.exe.config
|
|||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.exe
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\AgroBase.pdb
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.AssemblyReference.cache
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmDiagnosticos.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.frmPrincipal.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmInstancial.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmJoystick.resources
|
||||
|
|
@ -28,4 +27,8 @@ C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.DirectX.Direct
|
|||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.DirectX.dll
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Microsoft.DirectX.xml
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.csproj.CopyComplete
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmPlotMovimentacao.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.Movimentacao.frmMovConfig.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmMovDiagnosticos.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\obj\Debug\AgroBase.Forms.frmMovPlot.resources
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Newtonsoft.Json.dll
|
||||
C:\Zendion Inc\agrobot_base\AgroBase\AgroBase\bin\Debug\Newtonsoft.Json.xml
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
|
||||
<package id="System.Runtime" version="4.3.1" targetFramework="net472" />
|
||||
</packages>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,20 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2007 James Newton-King
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
Binary file not shown.
|
|
@ -0,0 +1,71 @@
|
|||
#  Json.NET
|
||||
|
||||
[](https://www.nuget.org/packages/Newtonsoft.Json/)
|
||||
[](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
|
||||
|
||||
Json.NET is a popular high-performance JSON framework for .NET
|
||||
|
||||
## Serialize JSON
|
||||
|
||||
```csharp
|
||||
Product product = new Product();
|
||||
product.Name = "Apple";
|
||||
product.Expiry = new DateTime(2008, 12, 28);
|
||||
product.Sizes = new string[] { "Small" };
|
||||
|
||||
string json = JsonConvert.SerializeObject(product);
|
||||
// {
|
||||
// "Name": "Apple",
|
||||
// "Expiry": "2008-12-28T00:00:00",
|
||||
// "Sizes": [
|
||||
// "Small"
|
||||
// ]
|
||||
// }
|
||||
```
|
||||
|
||||
## Deserialize JSON
|
||||
|
||||
```csharp
|
||||
string json = @"{
|
||||
'Name': 'Bad Boys',
|
||||
'ReleaseDate': '1995-4-7T00:00:00',
|
||||
'Genres': [
|
||||
'Action',
|
||||
'Comedy'
|
||||
]
|
||||
}";
|
||||
|
||||
Movie m = JsonConvert.DeserializeObject<Movie>(json);
|
||||
|
||||
string name = m.Name;
|
||||
// Bad Boys
|
||||
```
|
||||
|
||||
## LINQ to JSON
|
||||
|
||||
```csharp
|
||||
JArray array = new JArray();
|
||||
array.Add("Manual text");
|
||||
array.Add(new DateTime(2000, 5, 23));
|
||||
|
||||
JObject o = new JObject();
|
||||
o["MyArray"] = array;
|
||||
|
||||
string json = o.ToString();
|
||||
// {
|
||||
// "MyArray": [
|
||||
// "Manual text",
|
||||
// "2000-05-23T00:00:00"
|
||||
// ]
|
||||
// }
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
- [Homepage](https://www.newtonsoft.com/json)
|
||||
- [Documentation](https://www.newtonsoft.com/json/help)
|
||||
- [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
|
||||
- [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
|
||||
- [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
|
||||
- [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
|
||||
- [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.dll
vendored
Normal file
BIN
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11051
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.xml
vendored
Normal file
11051
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.0/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.dll
vendored
Normal file
BIN
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11173
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.xml
vendored
Normal file
11173
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard1.3/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.dll
vendored
Normal file
BIN
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
11338
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.xml
vendored
Normal file
11338
AgroBase/packages/Newtonsoft.Json.13.0.3/lib/netstandard2.0/Newtonsoft.Json.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 8.7 KiB |
|
|
@ -0,0 +1,210 @@
|
|||
#include "C:\Zendion Inc\agrobot_base\Firmware\Modulos\SerialService.h"
|
||||
#define D_Code Dir
|
||||
|
||||
int PinoReleGeral = 23;
|
||||
bool Conectado = false;
|
||||
|
||||
int _TaxaAmostragem;
|
||||
bool M1_Ativado = false;
|
||||
bool M2_Ativado = false;
|
||||
bool M3_Ativado = false;
|
||||
bool M4_Ativado = false;
|
||||
|
||||
class Motor {
|
||||
public:
|
||||
// Construtor
|
||||
Motor(String desc, int canal, int _ena, int _dir, int _pul) {
|
||||
_descricao = desc;
|
||||
_canal = canal;
|
||||
_pinoENA = _ena;
|
||||
_pinoDIR = _dir;
|
||||
_pinoPUL = _pul;
|
||||
}
|
||||
|
||||
// Definições
|
||||
String _descricao;
|
||||
int _canal;
|
||||
int _pinoENA;
|
||||
int _pinoDIR;
|
||||
int _pinoPUL;
|
||||
|
||||
bool Iniciado = false;
|
||||
bool Testando = false;
|
||||
|
||||
// Consumo
|
||||
double Angulo;
|
||||
|
||||
// Entrada de dados
|
||||
double _Angulo_SP;
|
||||
Sentido _Sentido = Parado;
|
||||
|
||||
void Inicializar() {
|
||||
if (Iniciado) {
|
||||
EnviarDadosSerial(_descricao + " ja inicializado");
|
||||
return;
|
||||
}
|
||||
|
||||
pinMode(_pinoENA, OUTPUT);
|
||||
pinMode(_pinoDIR, OUTPUT);
|
||||
pinMode(_pinoPUL, OUTPUT);
|
||||
|
||||
digitalWrite(_pinoENA, LOW);
|
||||
digitalWrite(_pinoDIR, LOW);
|
||||
digitalWrite(_pinoPUL, LOW);
|
||||
|
||||
ledcSetup(_canal, 1000, 10);
|
||||
ledcAttachPin(_pinoPUL, _canal);
|
||||
|
||||
EnviarDadosSerial(_descricao + " Iniciado");
|
||||
|
||||
Iniciado = true;
|
||||
|
||||
EnviarDadosSerial(MontarProtocoloSensor(sCfg, _descricao, Iniciado ? "1" : "0"));
|
||||
}
|
||||
|
||||
void Desligar() {
|
||||
if (!Iniciado) {
|
||||
EnviarDadosSerial(_descricao + " nao esta inicializado");
|
||||
return;
|
||||
}
|
||||
|
||||
// Desanexar o canal PWM
|
||||
ledcDetachPin(_pinoPUL);
|
||||
|
||||
// Redefinir as configurações para os valores iniciais
|
||||
pinMode(_pinoENA, INPUT);
|
||||
pinMode(_pinoDIR, INPUT);
|
||||
pinMode(_pinoPUL, INPUT);
|
||||
|
||||
// Outras redefinições de variáveis de estado, se necessário
|
||||
|
||||
|
||||
EnviarDadosSerial(_descricao + " Desligado");
|
||||
|
||||
Iniciado = false;
|
||||
|
||||
EnviarDadosSerial(MontarProtocoloSensor(sCfg, _descricao, Iniciado ? "1" : "0"));
|
||||
}
|
||||
|
||||
void Testar() {
|
||||
Testando = true;
|
||||
|
||||
Testando = false;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
};
|
||||
|
||||
Motor M1("ET", 0, 13, 12, 22);
|
||||
Motor M2("EF", 1, 14, 33, 32);
|
||||
Motor M3("DT", 2, 15, 02, 04);
|
||||
Motor M4("DF", 3, 05, 18, 21);
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
pinMode(PinoReleGeral, OUTPUT);
|
||||
digitalWrite(PinoReleGeral, LOW);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
if (Serial.available() > 3) {
|
||||
//Serial.println();
|
||||
String Protocolo = "";
|
||||
//1000;080;1;020;001
|
||||
F_Code _funcao = Nda;
|
||||
while (Serial.available()) {
|
||||
char Entrada = (char)Serial.read();
|
||||
//Serial.print(Entrada);
|
||||
if (Entrada == EndLine) {
|
||||
break;
|
||||
}
|
||||
Protocolo += Entrada;
|
||||
if (Protocolo.length() == 3) {
|
||||
if (_funcao == Nda) {
|
||||
_funcao = (F_Code)((String)Protocolo[0] + (String)Protocolo[1] + (String)Protocolo[2]).toInt();
|
||||
Protocolo = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_funcao == Chk) {
|
||||
EnviarDadosSerial(MontarProtocoloVerificacao(D_Code));
|
||||
}
|
||||
else if (_funcao == Cfg) {
|
||||
Conectado = (String)Protocolo[0] == "1";
|
||||
_TaxaAmostragem = ((String)Protocolo[2] + (String)Protocolo[3] + (String)Protocolo[4] + (String)Protocolo[5] + (String)Protocolo[6]).toInt();
|
||||
M1_Ativado = (String)Protocolo[8] == "1";
|
||||
M2_Ativado = (String)Protocolo[10] == "1";
|
||||
M3_Ativado = (String)Protocolo[12] == "1";
|
||||
M4_Ativado = (String)Protocolo[14] == "1";
|
||||
|
||||
if (M1_Ativado) {
|
||||
if (Conectado) {
|
||||
M1.Inicializar();
|
||||
}
|
||||
else {
|
||||
M1.Desligar();
|
||||
}
|
||||
vTaskDelay(500);
|
||||
}
|
||||
if (M2_Ativado) {
|
||||
if (Conectado) {
|
||||
M2.Inicializar();
|
||||
}
|
||||
else {
|
||||
M2.Desligar();
|
||||
}
|
||||
vTaskDelay(500);
|
||||
}
|
||||
if (M3_Ativado) {
|
||||
if (Conectado) {
|
||||
M3.Inicializar();
|
||||
}
|
||||
else {
|
||||
M3.Desligar();
|
||||
}
|
||||
vTaskDelay(500);
|
||||
}
|
||||
if (M4_Ativado) {
|
||||
if (Conectado) {
|
||||
M4.Inicializar();
|
||||
}
|
||||
else {
|
||||
M4.Desligar();
|
||||
}
|
||||
vTaskDelay(500);
|
||||
}
|
||||
|
||||
digitalWrite(PinoReleGeral, Conectado);
|
||||
|
||||
vTaskDelay(100);
|
||||
|
||||
EnviarDadosSerial(MontarProtocoloSensor(sCfg, "MOD", Conectado ? "1" : "0"));
|
||||
}
|
||||
else if (_funcao == Cmd) {
|
||||
//canal;sentido;angulo
|
||||
//0;0;000.00
|
||||
int Canal = ((String)Protocolo[0]).toInt();
|
||||
|
||||
Motor* _motor = Canal == 0 ? &M1 : Canal == 1 ? &M2 : Canal == 2 ? &M3 : &M4;
|
||||
|
||||
_motor->_Sentido = (Sentido)((String)Protocolo[2]).toInt();
|
||||
_motor->_Angulo_SP = ((String)Protocolo[4] + (String)Protocolo[5] + (String)Protocolo[6] + (String)Protocolo[7] + (String)Protocolo[8] + (String)Protocolo[9]).toInt();
|
||||
}
|
||||
else if (_funcao == Tst) {
|
||||
int Canal = ((String)Protocolo[0]).toInt();
|
||||
|
||||
Motor* _motor = Canal == 0 ? &M1 : Canal == 1 ? &M2 : Canal == 2 ? &M3 : &M4;
|
||||
|
||||
bool EmTeste = _motor->Testando;
|
||||
if (!EmTeste) {
|
||||
_motor->Testar();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
delay(10);
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
FROM espressif/idf
|
||||
|
||||
ARG DEBIAN_FRONTEND=nointeractive
|
||||
ARG CONTAINER_USER=esp
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt install -y -q \
|
||||
cmake \
|
||||
git \
|
||||
hwdata \
|
||||
libglib2.0-0 \
|
||||
libnuma1 \
|
||||
libpixman-1-0 \
|
||||
linux-tools-virtual \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20
|
||||
|
||||
# QEMU
|
||||
ENV QEMU_REL=esp-develop-20220919
|
||||
ENV QEMU_SHA256=f6565d3f0d1e463a63a7f81aec94cce62df662bd42fc7606de4b4418ed55f870
|
||||
ENV QEMU_DIST=qemu-${QEMU_REL}.tar.bz2
|
||||
ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/${QEMU_REL}/${QEMU_DIST}
|
||||
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
|
||||
RUN wget --no-verbose ${QEMU_URL} \
|
||||
&& echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \
|
||||
&& tar -xf $QEMU_DIST -C /opt \
|
||||
&& rm ${QEMU_DIST}
|
||||
|
||||
ENV PATH=/opt/qemu/bin:${PATH}
|
||||
|
||||
RUN groupadd --gid $USER_GID $CONTAINER_USER \
|
||||
&& adduser --uid $USER_UID --gid $USER_GID --disabled-password --gecos "" ${CONTAINER_USER} \
|
||||
&& usermod -a -G dialout $CONTAINER_USER
|
||||
USER ${CONTAINER_USER}
|
||||
ENV USER=${CONTAINER_USER}
|
||||
WORKDIR /home/${CONTAINER_USER}
|
||||
|
||||
RUN echo "source /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc
|
||||
|
||||
ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
|
||||
|
||||
CMD ["/bin/bash", "-c"]
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/ubuntu
|
||||
{
|
||||
"name": "ESP-IDF QEMU",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
// Add the IDs of extensions you want installed when the container is created
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
|
||||
/* the path of workspace folder to be opened after container is running
|
||||
*/
|
||||
"workspaceFolder": "${localWorkspaceFolder}",
|
||||
"mounts": [
|
||||
"source=extensionCache,target=/root/.vscode-server/extensions,type=volume"
|
||||
],
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"idf.espIdfPath": "/opt/esp/idf",
|
||||
"idf.customExtraPaths": "",
|
||||
"idf.pythonBinPath": "/opt/esp/python_env/idf5.1_py3.8_env/bin/python",
|
||||
"idf.toolsPath": "/opt/esp",
|
||||
"idf.gitPath": "/usr/bin/git"
|
||||
},
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools",
|
||||
"espressif.esp-idf-extension"
|
||||
],
|
||||
},
|
||||
"codespaces": {
|
||||
"settings": {
|
||||
"terminal.integrated.defaultProfile.linux": "bash",
|
||||
"idf.espIdfPath": "/opt/esp/idf",
|
||||
"idf.customExtraPaths": "",
|
||||
"idf.pythonBinPath": "/opt/esp/python_env/idf5.1_py3.8_env/bin/python",
|
||||
"idf.toolsPath": "/opt/esp",
|
||||
"idf.gitPath": "/usr/bin/git"
|
||||
},
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools",
|
||||
"espressif.esp-idf-extension"
|
||||
],
|
||||
}
|
||||
},
|
||||
"runArgs": ["--privileged"]
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "ESP-IDF",
|
||||
"compilerPath": "C:\\Espressif\\tools\\xtensa-esp32-elf\\esp-12.2.0_20230208\\xtensa-esp32-elf\\bin\\xtensa-esp32-elf-gcc.exe",
|
||||
"includePath": [
|
||||
"${config:idf.espIdfPath}/components/**",
|
||||
"${config:idf.espIdfPathWin}/components/**",
|
||||
"${config:idf.espAdfPath}/components/**",
|
||||
"${config:idf.espAdfPathWin}/components/**",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"browse": {
|
||||
"path": [
|
||||
"${config:idf.espIdfPath}/components",
|
||||
"${config:idf.espIdfPathWin}/components",
|
||||
"${config:idf.espAdfPath}/components/**",
|
||||
"${config:idf.espAdfPathWin}/components/**",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"limitSymbolsToIncludedHeaders": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "espidf",
|
||||
"name": "Launch",
|
||||
"request": "launch"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"C_Cpp.intelliSenseEngine": "default",
|
||||
"idf.adapterTargetName": "esp32",
|
||||
"idf.customExtraPaths": "C:\\Espressif\\tools\\xtensa-esp-elf-gdb\\12.1_20221002\\xtensa-esp-elf-gdb\\bin;C:\\Espressif\\tools\\riscv32-esp-elf-gdb\\12.1_20221002\\riscv32-esp-elf-gdb\\bin;C:\\Espressif\\tools\\xtensa-esp32-elf\\esp-12.2.0_20230208\\xtensa-esp32-elf\\bin;C:\\Espressif\\tools\\xtensa-esp32s2-elf\\esp-12.2.0_20230208\\xtensa-esp32s2-elf\\bin;C:\\Espressif\\tools\\xtensa-esp32s3-elf\\esp-12.2.0_20230208\\xtensa-esp32s3-elf\\bin;C:\\Espressif\\tools\\riscv32-esp-elf\\esp-12.2.0_20230208\\riscv32-esp-elf\\bin;C:\\Espressif\\tools\\esp32ulp-elf\\2.35_20220830\\esp32ulp-elf\\bin;C:\\Espressif\\tools\\cmake\\3.24.0\\bin;C:\\Espressif\\tools\\openocd-esp32\\v0.12.0-esp32-20230419\\openocd-esp32\\bin;C:\\Espressif\\tools\\ninja\\1.10.2;C:\\Espressif\\tools\\idf-exe\\1.0.3;C:\\Espressif\\tools\\ccache\\4.8\\ccache-4.8-windows-x86_64;C:\\Espressif\\tools\\dfu-util\\0.11\\dfu-util-0.11-win64;C:\\Espressif\\tools\\esp-rom-elfs\\20230320",
|
||||
"idf.customExtraVars": {
|
||||
"OPENOCD_SCRIPTS": "C:\\Espressif\\tools\\openocd-esp32\\v0.12.0-esp32-20230419/openocd-esp32/share/openocd/scripts",
|
||||
"IDF_CCACHE_ENABLE": "1",
|
||||
"ESP_ROM_ELF_DIR": "C:\\Espressif\\tools\\esp-rom-elfs\\20230320/"
|
||||
},
|
||||
"idf.espIdfPathWin": "C:\\Users\\Grão de Gente - TI\\esp\\esp-idf",
|
||||
"idf.openOcdConfigs": [
|
||||
"board/esp32-wrover-kit-3.3v.cfg"
|
||||
],
|
||||
"idf.pythonBinPathWin": "C:\\Espressif\\python_env\\idf5.1_py3.11_env\\Scripts\\python.exe",
|
||||
"idf.toolsPathWin": "C:\\Espressif"
|
||||
}
|
||||
|
|
@ -0,0 +1,300 @@
|
|||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "Build - Build project",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py build",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py build",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Set ESP-IDF Target",
|
||||
"type": "shell",
|
||||
"command": "${command:espIdf.setTarget}",
|
||||
"problemMatcher": {
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^(.*):(//d+):(//d+)://s+(warning|error)://s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Clean - Clean the project",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py fullclean",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py fullclean",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Flash - Flash the device",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.flashBaudRate} flash",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py flash -p ${config:idf.portWin} -b ${config:idf.flashBaudRate}",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Monitor: Start the monitor",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} monitor",
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py -p ${config:idf.portWin} monitor",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceFolder}"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "^\\.\\.(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^[^\\.](.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"dependsOn": "Flash - Flash the device"
|
||||
},
|
||||
{
|
||||
"label": "OpenOCD: Start openOCD",
|
||||
"type": "shell",
|
||||
"presentation": {
|
||||
"echo": true,
|
||||
"reveal": "never",
|
||||
"focus": false,
|
||||
"panel": "new"
|
||||
},
|
||||
"command": "openocd -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}",
|
||||
"windows": {
|
||||
"command": "openocd.exe -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}"
|
||||
}
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}"
|
||||
}
|
||||
},
|
||||
"problemMatcher": {
|
||||
"owner": "cpp",
|
||||
"fileLocation": "absolute",
|
||||
"pattern": {
|
||||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 5
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "adapter",
|
||||
"type": "shell",
|
||||
"command": "${config:idf.pythonBinPath}",
|
||||
"isBackground": true,
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH}:${config:idf.customExtraPaths}",
|
||||
"PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter"
|
||||
}
|
||||
},
|
||||
"problemMatcher": {
|
||||
"background": {
|
||||
"beginsPattern": "\bDEBUG_ADAPTER_STARTED\b",
|
||||
"endsPattern": "DEBUG_ADAPTER_READY2CONNECT",
|
||||
"activeOnStart": true
|
||||
},
|
||||
"pattern": {
|
||||
"regexp": "(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+),(\\d+)\\s-(.+)\\s(ERROR)",
|
||||
"file": 8,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"severity": 4,
|
||||
"message": 9
|
||||
}
|
||||
},
|
||||
"args": [
|
||||
"${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter_main.py",
|
||||
"-e",
|
||||
"${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
|
||||
"-s",
|
||||
"${command:espIdf.getOpenOcdScriptValue}",
|
||||
"-ip",
|
||||
"localhost",
|
||||
"-dn",
|
||||
"${config:idf.adapterTargetName}",
|
||||
"-om",
|
||||
"connect_to_instance"
|
||||
],
|
||||
"windows": {
|
||||
"command": "${config:idf.pythonBinPathWin}",
|
||||
"options": {
|
||||
"env": {
|
||||
"PATH": "${env:PATH};${config:idf.customExtraPaths}",
|
||||
"PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
# The following five lines of boilerplate have to be in your project's
|
||||
# CMakeLists in this exact order for cmake to work correctly
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(AgroboticsMOV)
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
# Blink Example
|
||||
|
||||
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
||||
|
||||
This example demonstrates how to blink a LED using GPIO or using the [led_strip](https://components.espressif.com/component/espressif/led_strip) component for the addressable LED, i.e. [WS2812](https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf).
|
||||
|
||||
The `led_strip` is installed via [component manager](main/idf_component.yml).
|
||||
|
||||
## How to Use Example
|
||||
|
||||
Before project configuration and build, be sure to set the correct chip target using `idf.py set-target <chip_name>`.
|
||||
|
||||
### Hardware Required
|
||||
|
||||
* A development board with Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for Power supply and programming
|
||||
|
||||
Some development boards use an addressable LED instead of a regular one. These development boards include:
|
||||
|
||||
| Board | LED type | Pin |
|
||||
| -------------------- | -------------------- | -------------------- |
|
||||
| ESP32-C3-DevKitC-1 | Addressable | GPIO8 |
|
||||
| ESP32-C3-DevKitM-1 | Addressable | GPIO8 |
|
||||
| ESP32-S2-DevKitM-1 | Addressable | GPIO18 |
|
||||
| ESP32-S2-Saola-1 | Addressable | GPIO18 |
|
||||
| ESP32-S3-DevKitC-1 | Addressable | GPIO48 |
|
||||
|
||||
See [Development Boards](https://www.espressif.com/en/products/devkits) for more information about it.
|
||||
|
||||
### Configure the Project
|
||||
|
||||
Open the project configuration menu (`idf.py menuconfig`).
|
||||
|
||||
In the `Example Configuration` menu:
|
||||
|
||||
* Select the LED type in the `Blink LED type` option.
|
||||
* Use `GPIO` for regular LED blink.
|
||||
* Set the GPIO number used for the signal in the `Blink GPIO number` option.
|
||||
* Set the blinking period in the `Blink period in ms` option.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.
|
||||
|
||||
(To exit the serial monitor, type ``Ctrl-]``.)
|
||||
|
||||
See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects.
|
||||
|
||||
## Example Output
|
||||
|
||||
As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `led_strip_set_pixel(led_strip, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the [source file](main/blink_example_main.c).
|
||||
|
||||
```text
|
||||
I (315) example: Example configured to blink addressable LED!
|
||||
I (325) example: Turning the LED OFF!
|
||||
I (1325) example: Turning the LED ON!
|
||||
I (2325) example: Turning the LED OFF!
|
||||
I (3325) example: Turning the LED ON!
|
||||
I (4325) example: Turning the LED OFF!
|
||||
I (5325) example: Turning the LED ON!
|
||||
I (6325) example: Turning the LED OFF!
|
||||
I (7325) example: Turning the LED ON!
|
||||
I (8325) example: Turning the LED OFF!
|
||||
```
|
||||
|
||||
Note: The color order could be different according to the LED model.
|
||||
|
||||
The pixel number indicates the pixel position in the LED strip. For a single LED, use 0.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
* If the LED isn't blinking, check the GPIO or the LED type selection in the `Example Configuration` menu.
|
||||
|
||||
For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you soon.
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
set(CMAKE_ASM_COMPILER "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe")
|
||||
set(CMAKE_ASM_COMPILER_ARG1 "")
|
||||
set(CMAKE_AR "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ar.exe")
|
||||
set(CMAKE_ASM_COMPILER_AR "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc-ar.exe")
|
||||
set(CMAKE_RANLIB "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ranlib.exe")
|
||||
set(CMAKE_ASM_COMPILER_RANLIB "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc-ranlib.exe")
|
||||
set(CMAKE_LINKER "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ld.exe")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_ASM_COMPILER_LOADED 1)
|
||||
set(CMAKE_ASM_COMPILER_ID "GNU")
|
||||
set(CMAKE_ASM_COMPILER_VERSION "")
|
||||
set(CMAKE_ASM_COMPILER_ENV_VAR "ASM")
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_ASM_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_ASM_LINKER_PREFERENCE 0)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
set(CMAKE_C_COMPILER "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe")
|
||||
set(CMAKE_C_COMPILER_ARG1 "")
|
||||
set(CMAKE_C_COMPILER_ID "GNU")
|
||||
set(CMAKE_C_COMPILER_VERSION "12.2.0")
|
||||
set(CMAKE_C_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_C_COMPILER_WRAPPER "")
|
||||
set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17")
|
||||
set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON")
|
||||
set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23")
|
||||
set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
|
||||
set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
|
||||
set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
|
||||
set(CMAKE_C17_COMPILE_FEATURES "c_std_17")
|
||||
set(CMAKE_C23_COMPILE_FEATURES "c_std_23")
|
||||
|
||||
set(CMAKE_C_PLATFORM_ID "")
|
||||
set(CMAKE_C_SIMULATE_ID "")
|
||||
set(CMAKE_C_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_C_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ar.exe")
|
||||
set(CMAKE_C_COMPILER_AR "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc-ar.exe")
|
||||
set(CMAKE_RANLIB "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ranlib.exe")
|
||||
set(CMAKE_C_COMPILER_RANLIB "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc-ranlib.exe")
|
||||
set(CMAKE_LINKER "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ld.exe")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCC 1)
|
||||
set(CMAKE_C_COMPILER_LOADED 1)
|
||||
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_C_ABI_COMPILED TRUE)
|
||||
|
||||
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||
|
||||
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)
|
||||
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_C_SIZEOF_DATA_PTR "4")
|
||||
set(CMAKE_C_COMPILER_ABI "ELF")
|
||||
set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN")
|
||||
set(CMAKE_C_LIBRARY_ARCHITECTURE "")
|
||||
|
||||
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_C_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/12.2.0/include;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/12.2.0/include-fixed;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include")
|
||||
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "gcc;c;nosys;c;gcc")
|
||||
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/12.2.0;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/lib")
|
||||
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
set(CMAKE_CXX_COMPILER "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe")
|
||||
set(CMAKE_CXX_COMPILER_ARG1 "")
|
||||
set(CMAKE_CXX_COMPILER_ID "GNU")
|
||||
set(CMAKE_CXX_COMPILER_VERSION "12.2.0")
|
||||
set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "")
|
||||
set(CMAKE_CXX_COMPILER_WRAPPER "")
|
||||
set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "17")
|
||||
set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON")
|
||||
set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23")
|
||||
set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
|
||||
set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
|
||||
set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
|
||||
set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
|
||||
set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20")
|
||||
set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23")
|
||||
|
||||
set(CMAKE_CXX_PLATFORM_ID "")
|
||||
set(CMAKE_CXX_SIMULATE_ID "")
|
||||
set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "")
|
||||
set(CMAKE_CXX_SIMULATE_VERSION "")
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_AR "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ar.exe")
|
||||
set(CMAKE_CXX_COMPILER_AR "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc-ar.exe")
|
||||
set(CMAKE_RANLIB "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ranlib.exe")
|
||||
set(CMAKE_CXX_COMPILER_RANLIB "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc-ranlib.exe")
|
||||
set(CMAKE_LINKER "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-ld.exe")
|
||||
set(CMAKE_MT "")
|
||||
set(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||
set(CMAKE_CXX_COMPILER_LOADED 1)
|
||||
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||
set(CMAKE_CXX_ABI_COMPILED TRUE)
|
||||
|
||||
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||
|
||||
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm)
|
||||
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||
|
||||
foreach (lang C OBJC OBJCXX)
|
||||
if (CMAKE_${lang}_COMPILER_ID_RUN)
|
||||
foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS)
|
||||
list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension})
|
||||
endforeach()
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE 30)
|
||||
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||
|
||||
# Save compiler ABI information.
|
||||
set(CMAKE_CXX_SIZEOF_DATA_PTR "4")
|
||||
set(CMAKE_CXX_COMPILER_ABI "ELF")
|
||||
set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN")
|
||||
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "")
|
||||
|
||||
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ABI)
|
||||
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
||||
endif()
|
||||
|
||||
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
||||
set(CMAKE_LIBRARY_ARCHITECTURE "")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "")
|
||||
if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX)
|
||||
set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/xtensa-esp32-elf;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/backward;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/12.2.0/include;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/12.2.0/include-fixed;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "stdc++;m;gcc;c;nosys;c;gcc")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/12.2.0;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/lib/gcc;C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/lib")
|
||||
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "")
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,15 @@
|
|||
set(CMAKE_HOST_SYSTEM "Windows-10.0.22621")
|
||||
set(CMAKE_HOST_SYSTEM_NAME "Windows")
|
||||
set(CMAKE_HOST_SYSTEM_VERSION "10.0.22621")
|
||||
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
|
||||
|
||||
include("C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/toolchain-esp32.cmake")
|
||||
|
||||
set(CMAKE_SYSTEM "Generic")
|
||||
set(CMAKE_SYSTEM_NAME "Generic")
|
||||
set(CMAKE_SYSTEM_VERSION "")
|
||||
set(CMAKE_SYSTEM_PROCESSOR "")
|
||||
|
||||
set(CMAKE_CROSSCOMPILING "TRUE")
|
||||
|
||||
set(CMAKE_SYSTEM_LOADED 1)
|
||||
|
|
@ -0,0 +1,838 @@
|
|||
#ifdef __cplusplus
|
||||
# error "A C++ compiler has been selected for C."
|
||||
#endif
|
||||
|
||||
#if defined(__18CXX)
|
||||
# define ID_VOID_MAIN
|
||||
#endif
|
||||
#if defined(__CLASSIC_C__)
|
||||
/* cv-qualifiers did not exist in K&R C */
|
||||
# define const
|
||||
# define volatile
|
||||
#endif
|
||||
|
||||
#if !defined(__has_include)
|
||||
/* If the compiler does not have __has_include, pretend the answer is
|
||||
always no. */
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
|
||||
except that a few beta releases use the old format with V=2021. */
|
||||
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
|
||||
/* The third version component from --version is an update index,
|
||||
but no macro is provided for it. */
|
||||
# define COMPILER_VERSION_PATCH DEC(0)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
|
||||
# define COMPILER_ID "IntelLLVM"
|
||||
#if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
#endif
|
||||
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
|
||||
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
|
||||
* VVVV is no smaller than the current year when a version is released.
|
||||
*/
|
||||
#if __INTEL_LLVM_COMPILER < 1000000L
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
|
||||
#else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
#elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
#endif
|
||||
#if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
#endif
|
||||
#if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
#endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_C)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_C >= 0x5100
|
||||
/* __SUNPRO_C = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_cc)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_cc = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100)
|
||||
|
||||
#elif defined(__DECC)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECC_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
|
||||
|
||||
#elif defined(__IBMC__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__open_xl__) && defined(__clang__)
|
||||
# define COMPILER_ID "IBMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMC__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10)
|
||||
|
||||
#elif defined(__NVCOMPILER)
|
||||
# define COMPILER_ID "NVHPC"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
|
||||
# if defined(__NVCOMPILER_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__CLANG_FUJITSU)
|
||||
# define COMPILER_ID "FujitsuClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||
|
||||
|
||||
#elif defined(__FUJITSU)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
# if defined(__FCC_version__)
|
||||
# define COMPILER_VERSION __FCC_version__
|
||||
# elif defined(__FCC_major__)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||
# endif
|
||||
# if defined(__fcc_version)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
|
||||
# elif defined(__FCC_VERSION)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
|
||||
# endif
|
||||
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__TINYC__)
|
||||
# define COMPILER_ID "TinyCC"
|
||||
|
||||
#elif defined(__BCC__)
|
||||
# define COMPILER_ID "Bruce"
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
|
||||
# define COMPILER_ID "LCC"
|
||||
# define COMPILER_VERSION_MAJOR DEC(1)
|
||||
# if defined(__LCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__LCC__- 100)
|
||||
# endif
|
||||
# if defined(__LCC_MINOR__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(_ADI_COMPILER)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VERSIONNUM__)
|
||||
/* __VERSIONNUM__ = 0xVVRRPPTT */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
|
||||
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC)
|
||||
# define COMPILER_ID "SDCC"
|
||||
# if defined(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR)
|
||||
# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH)
|
||||
# else
|
||||
/* SDCC = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__MSYS__)
|
||||
# define PLATFORM_ID "MSYS"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# elif defined(__VXWORKS__)
|
||||
# define PLATFORM_ID "VxWorks"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
# elif defined(_ADI_COMPILER)
|
||||
# define PLATFORM_ID "ADSP"
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_ARM64EC)
|
||||
# define ARCHITECTURE_ID "ARM64EC"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# elif defined(__ICCSTM8__)
|
||||
# define ARCHITECTURE_ID "STM8"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# if defined(__TI_ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__MSP430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__TMS320C28XX__)
|
||||
# define ARCHITECTURE_ID "TMS320C28x"
|
||||
|
||||
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
|
||||
# define ARCHITECTURE_ID "TMS320C6x"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
# elif defined(__ADSPSHARC__)
|
||||
# define ARCHITECTURE_ID "SHARC"
|
||||
|
||||
# elif defined(__ADSPBLACKFIN__)
|
||||
# define ARCHITECTURE_ID "Blackfin"
|
||||
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number. */
|
||||
#ifdef COMPILER_VERSION
|
||||
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#elif defined(COMPILER_VERSION_MAJOR)
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#elif defined(COMPILER_VERSION_INTERNAL_STR)
|
||||
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
#if !defined(__STDC__) && !defined(__clang__)
|
||||
# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__)
|
||||
# define C_VERSION "90"
|
||||
# else
|
||||
# define C_VERSION
|
||||
# endif
|
||||
#elif __STDC_VERSION__ > 201710L
|
||||
# define C_VERSION "23"
|
||||
#elif __STDC_VERSION__ >= 201710L
|
||||
# define C_VERSION "17"
|
||||
#elif __STDC_VERSION__ >= 201000L
|
||||
# define C_VERSION "11"
|
||||
#elif __STDC_VERSION__ >= 199901L
|
||||
# define C_VERSION "99"
|
||||
#else
|
||||
# define C_VERSION "90"
|
||||
#endif
|
||||
const char* info_language_standard_default =
|
||||
"INFO" ":" "standard_default[" C_VERSION "]";
|
||||
|
||||
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
|
||||
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
|
||||
defined(__TI_COMPILER_VERSION__)) && \
|
||||
!defined(__STRICT_ANSI__)
|
||||
"ON"
|
||||
#else
|
||||
"OFF"
|
||||
#endif
|
||||
"]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ID_VOID_MAIN
|
||||
void main() {}
|
||||
#else
|
||||
# if defined(__CLASSIC_C__)
|
||||
int main(argc, argv) int argc; char *argv[];
|
||||
# else
|
||||
int main(int argc, char* argv[])
|
||||
# endif
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
require += info_arch[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_standard_default[argc];
|
||||
require += info_language_extensions_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
#endif
|
||||
Binary file not shown.
|
|
@ -0,0 +1,826 @@
|
|||
/* This source file must have a .cpp extension so that all C++ compilers
|
||||
recognize the extension without flags. Borland does not know .cxx for
|
||||
example. */
|
||||
#ifndef __cplusplus
|
||||
# error "A C compiler has been selected for C++."
|
||||
#endif
|
||||
|
||||
#if !defined(__has_include)
|
||||
/* If the compiler does not have __has_include, pretend the answer is
|
||||
always no. */
|
||||
# define __has_include(x) 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number components: V=Version, R=Revision, P=Patch
|
||||
Version date components: YYYY=Year, MM=Month, DD=Day */
|
||||
|
||||
#if defined(__COMO__)
|
||||
# define COMPILER_ID "Comeau"
|
||||
/* __COMO_VERSION__ = VRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
|
||||
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICC)
|
||||
# define COMPILER_ID "Intel"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# endif
|
||||
/* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later,
|
||||
except that a few beta releases use the old format with V=2021. */
|
||||
# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
|
||||
# if defined(__INTEL_COMPILER_UPDATE)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
|
||||
# else
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10)
|
||||
# endif
|
||||
# else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
|
||||
/* The third version component from --version is an update index,
|
||||
but no macro is provided for it. */
|
||||
# define COMPILER_VERSION_PATCH DEC(0)
|
||||
# endif
|
||||
# if defined(__INTEL_COMPILER_BUILD_DATE)
|
||||
/* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */
|
||||
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
|
||||
# endif
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER)
|
||||
# define COMPILER_ID "IntelLLVM"
|
||||
#if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
#endif
|
||||
/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
|
||||
* later. Look for 6 digit vs. 8 digit version number to decide encoding.
|
||||
* VVVV is no smaller than the current year when a version is released.
|
||||
*/
|
||||
#if __INTEL_LLVM_COMPILER < 1000000L
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10)
|
||||
#else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100)
|
||||
#endif
|
||||
#if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
#endif
|
||||
#if defined(__GNUC__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
#elif defined(__GNUG__)
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUG__)
|
||||
#endif
|
||||
#if defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
#endif
|
||||
#if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
#endif
|
||||
|
||||
#elif defined(__PATHCC__)
|
||||
# define COMPILER_ID "PathScale"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
|
||||
# if defined(__PATHCC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__)
|
||||
# define COMPILER_ID "Embarcadero"
|
||||
# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF)
|
||||
# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF)
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# define COMPILER_ID "Borland"
|
||||
/* __BORLANDC__ = 0xVRR */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
|
||||
|
||||
#elif defined(__WATCOMC__) && __WATCOMC__ < 1200
|
||||
# define COMPILER_ID "Watcom"
|
||||
/* __WATCOMC__ = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# define COMPILER_ID "OpenWatcom"
|
||||
/* __WATCOMC__ = VVRP + 1100 */
|
||||
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
|
||||
# if (__WATCOMC__ % 10) > 0
|
||||
# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SUNPRO_CC)
|
||||
# define COMPILER_ID "SunPro"
|
||||
# if __SUNPRO_CC >= 0x5100
|
||||
/* __SUNPRO_CC = 0xVRRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# else
|
||||
/* __SUNPRO_CC = 0xVRP */
|
||||
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
|
||||
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
|
||||
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF)
|
||||
# endif
|
||||
|
||||
#elif defined(__HP_aCC)
|
||||
# define COMPILER_ID "HP"
|
||||
/* __HP_aCC = VVRRPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100)
|
||||
|
||||
#elif defined(__DECCXX)
|
||||
# define COMPILER_ID "Compaq"
|
||||
/* __DECCXX_VER = VVRRTPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
|
||||
|
||||
#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
|
||||
# define COMPILER_ID "zOS"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__open_xl__) && defined(__clang__)
|
||||
# define COMPILER_ID "IBMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__open_xl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__ibmxl__) && defined(__clang__)
|
||||
# define COMPILER_ID "XLClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)
|
||||
|
||||
|
||||
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
|
||||
# define COMPILER_ID "XL"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
|
||||
# define COMPILER_ID "VisualAge"
|
||||
/* __IBMCPP__ = VRP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10)
|
||||
|
||||
#elif defined(__NVCOMPILER)
|
||||
# define COMPILER_ID "NVHPC"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
|
||||
# if defined(__NVCOMPILER_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(__PGI)
|
||||
# define COMPILER_ID "PGI"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
|
||||
# if defined(__PGIC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_CRAYC)
|
||||
# define COMPILER_ID "Cray"
|
||||
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
|
||||
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# define COMPILER_ID "TI"
|
||||
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
|
||||
|
||||
#elif defined(__CLANG_FUJITSU)
|
||||
# define COMPILER_ID "FujitsuClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||
# define COMPILER_VERSION_INTERNAL_STR __clang_version__
|
||||
|
||||
|
||||
#elif defined(__FUJITSU)
|
||||
# define COMPILER_ID "Fujitsu"
|
||||
# if defined(__FCC_version__)
|
||||
# define COMPILER_VERSION __FCC_version__
|
||||
# elif defined(__FCC_major__)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__FCC_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__FCC_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__)
|
||||
# endif
|
||||
# if defined(__fcc_version)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__fcc_version)
|
||||
# elif defined(__FCC_VERSION)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION)
|
||||
# endif
|
||||
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# define COMPILER_ID "GHS"
|
||||
/* __GHS_VERSION_NUMBER = VVVVRP */
|
||||
# ifdef __GHS_VERSION_NUMBER
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10)
|
||||
# endif
|
||||
|
||||
#elif defined(__SCO_VERSION__)
|
||||
# define COMPILER_ID "SCO"
|
||||
|
||||
#elif defined(__ARMCC_VERSION) && !defined(__clang__)
|
||||
# define COMPILER_ID "ARMCC"
|
||||
#if __ARMCC_VERSION >= 1000000
|
||||
/* __ARMCC_VERSION = VRRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#else
|
||||
/* __ARMCC_VERSION = VRPPPP */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000)
|
||||
#endif
|
||||
|
||||
|
||||
#elif defined(__clang__) && defined(__apple_build_version__)
|
||||
# define COMPILER_ID "AppleClang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__)
|
||||
|
||||
#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION)
|
||||
# define COMPILER_ID "ARMClang"
|
||||
# define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100)
|
||||
# define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION % 10000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION)
|
||||
|
||||
#elif defined(__clang__)
|
||||
# define COMPILER_ID "Clang"
|
||||
# if defined(_MSC_VER)
|
||||
# define SIMULATE_ID "MSVC"
|
||||
# endif
|
||||
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__clang_minor__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__)
|
||||
# if defined(_MSC_VER)
|
||||
/* _MSC_VER = VVRR */
|
||||
# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# endif
|
||||
|
||||
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
|
||||
# define COMPILER_ID "LCC"
|
||||
# define COMPILER_VERSION_MAJOR DEC(1)
|
||||
# if defined(__LCC__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__LCC__- 100)
|
||||
# endif
|
||||
# if defined(__LCC_MINOR__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC__) && defined(__GNUC_MINOR__)
|
||||
# define SIMULATE_ID "GNU"
|
||||
# define SIMULATE_VERSION_MAJOR DEC(__GNUC__)
|
||||
# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__) || defined(__GNUG__)
|
||||
# define COMPILER_ID "GNU"
|
||||
# if defined(__GNUC__)
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
|
||||
# else
|
||||
# define COMPILER_VERSION_MAJOR DEC(__GNUG__)
|
||||
# endif
|
||||
# if defined(__GNUC_MINOR__)
|
||||
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
|
||||
# endif
|
||||
# if defined(__GNUC_PATCHLEVEL__)
|
||||
# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
|
||||
# endif
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
# define COMPILER_ID "MSVC"
|
||||
/* _MSC_VER = VVRR */
|
||||
# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100)
|
||||
# if defined(_MSC_FULL_VER)
|
||||
# if _MSC_VER >= 1400
|
||||
/* _MSC_FULL_VER = VVRRPPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000)
|
||||
# else
|
||||
/* _MSC_FULL_VER = VVRRPPPP */
|
||||
# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000)
|
||||
# endif
|
||||
# endif
|
||||
# if defined(_MSC_BUILD)
|
||||
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
|
||||
# endif
|
||||
|
||||
#elif defined(_ADI_COMPILER)
|
||||
# define COMPILER_ID "ADSP"
|
||||
#if defined(__VERSIONNUM__)
|
||||
/* __VERSIONNUM__ = 0xVVRRPPTT */
|
||||
# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF)
|
||||
# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF)
|
||||
# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF)
|
||||
# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF)
|
||||
#endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# define COMPILER_ID "IAR"
|
||||
# if defined(__VER__) && defined(__ICCARM__)
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000)
|
||||
# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000)
|
||||
# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__))
|
||||
# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100)
|
||||
# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100))
|
||||
# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__)
|
||||
# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__)
|
||||
# endif
|
||||
|
||||
|
||||
/* These compilers are either not known or too old to define an
|
||||
identification macro. Try to identify the platform and guess that
|
||||
it is the native compiler. */
|
||||
#elif defined(__hpux) || defined(__hpua)
|
||||
# define COMPILER_ID "HP"
|
||||
|
||||
#else /* unknown compiler */
|
||||
# define COMPILER_ID ""
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
|
||||
#ifdef SIMULATE_ID
|
||||
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
|
||||
#endif
|
||||
|
||||
#ifdef __QNXNTO__
|
||||
char const* qnxnto = "INFO" ":" "qnxnto[]";
|
||||
#endif
|
||||
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
|
||||
#endif
|
||||
|
||||
#define STRINGIFY_HELPER(X) #X
|
||||
#define STRINGIFY(X) STRINGIFY_HELPER(X)
|
||||
|
||||
/* Identify known platforms by name. */
|
||||
#if defined(__linux) || defined(__linux__) || defined(linux)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
#elif defined(__MSYS__)
|
||||
# define PLATFORM_ID "MSYS"
|
||||
|
||||
#elif defined(__CYGWIN__)
|
||||
# define PLATFORM_ID "Cygwin"
|
||||
|
||||
#elif defined(__MINGW32__)
|
||||
# define PLATFORM_ID "MinGW"
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
# define PLATFORM_ID "Darwin"
|
||||
|
||||
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# define PLATFORM_ID "Windows"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD)
|
||||
# define PLATFORM_ID "FreeBSD"
|
||||
|
||||
#elif defined(__NetBSD__) || defined(__NetBSD)
|
||||
# define PLATFORM_ID "NetBSD"
|
||||
|
||||
#elif defined(__OpenBSD__) || defined(__OPENBSD)
|
||||
# define PLATFORM_ID "OpenBSD"
|
||||
|
||||
#elif defined(__sun) || defined(sun)
|
||||
# define PLATFORM_ID "SunOS"
|
||||
|
||||
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
|
||||
# define PLATFORM_ID "AIX"
|
||||
|
||||
#elif defined(__hpux) || defined(__hpux__)
|
||||
# define PLATFORM_ID "HP-UX"
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
# define PLATFORM_ID "Haiku"
|
||||
|
||||
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
|
||||
# define PLATFORM_ID "BeOS"
|
||||
|
||||
#elif defined(__QNX__) || defined(__QNXNTO__)
|
||||
# define PLATFORM_ID "QNX"
|
||||
|
||||
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
|
||||
# define PLATFORM_ID "Tru64"
|
||||
|
||||
#elif defined(__riscos) || defined(__riscos__)
|
||||
# define PLATFORM_ID "RISCos"
|
||||
|
||||
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
|
||||
# define PLATFORM_ID "SINIX"
|
||||
|
||||
#elif defined(__UNIX_SV__)
|
||||
# define PLATFORM_ID "UNIX_SV"
|
||||
|
||||
#elif defined(__bsdos__)
|
||||
# define PLATFORM_ID "BSDOS"
|
||||
|
||||
#elif defined(_MPRAS) || defined(MPRAS)
|
||||
# define PLATFORM_ID "MP-RAS"
|
||||
|
||||
#elif defined(__osf) || defined(__osf__)
|
||||
# define PLATFORM_ID "OSF1"
|
||||
|
||||
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
|
||||
# define PLATFORM_ID "SCO_SV"
|
||||
|
||||
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
|
||||
# define PLATFORM_ID "ULTRIX"
|
||||
|
||||
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
|
||||
# define PLATFORM_ID "Xenix"
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(__LINUX__)
|
||||
# define PLATFORM_ID "Linux"
|
||||
|
||||
# elif defined(__DOS__)
|
||||
# define PLATFORM_ID "DOS"
|
||||
|
||||
# elif defined(__OS2__)
|
||||
# define PLATFORM_ID "OS2"
|
||||
|
||||
# elif defined(__WINDOWS__)
|
||||
# define PLATFORM_ID "Windows3x"
|
||||
|
||||
# elif defined(__VXWORKS__)
|
||||
# define PLATFORM_ID "VxWorks"
|
||||
|
||||
# else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEGRITY)
|
||||
# if defined(INT_178B)
|
||||
# define PLATFORM_ID "Integrity178"
|
||||
|
||||
# else /* regular Integrity */
|
||||
# define PLATFORM_ID "Integrity"
|
||||
# endif
|
||||
|
||||
# elif defined(_ADI_COMPILER)
|
||||
# define PLATFORM_ID "ADSP"
|
||||
|
||||
#else /* unknown platform */
|
||||
# define PLATFORM_ID
|
||||
|
||||
#endif
|
||||
|
||||
/* For windows compilers MSVC and Intel we can determine
|
||||
the architecture of the compiler being used. This is because
|
||||
the compilers do not have flags that can change the architecture,
|
||||
but rather depend on which compiler is being used
|
||||
*/
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
# if defined(_M_IA64)
|
||||
# define ARCHITECTURE_ID "IA64"
|
||||
|
||||
# elif defined(_M_ARM64EC)
|
||||
# define ARCHITECTURE_ID "ARM64EC"
|
||||
|
||||
# elif defined(_M_X64) || defined(_M_AMD64)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# elif defined(_M_ARM64)
|
||||
# define ARCHITECTURE_ID "ARM64"
|
||||
|
||||
# elif defined(_M_ARM)
|
||||
# if _M_ARM == 4
|
||||
# define ARCHITECTURE_ID "ARMV4I"
|
||||
# elif _M_ARM == 5
|
||||
# define ARCHITECTURE_ID "ARMV5I"
|
||||
# else
|
||||
# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM)
|
||||
# endif
|
||||
|
||||
# elif defined(_M_MIPS)
|
||||
# define ARCHITECTURE_ID "MIPS"
|
||||
|
||||
# elif defined(_M_SH)
|
||||
# define ARCHITECTURE_ID "SHx"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__WATCOMC__)
|
||||
# if defined(_M_I86)
|
||||
# define ARCHITECTURE_ID "I86"
|
||||
|
||||
# elif defined(_M_IX86)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)
|
||||
# if defined(__ICCARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__ICCRX__)
|
||||
# define ARCHITECTURE_ID "RX"
|
||||
|
||||
# elif defined(__ICCRH850__)
|
||||
# define ARCHITECTURE_ID "RH850"
|
||||
|
||||
# elif defined(__ICCRL78__)
|
||||
# define ARCHITECTURE_ID "RL78"
|
||||
|
||||
# elif defined(__ICCRISCV__)
|
||||
# define ARCHITECTURE_ID "RISCV"
|
||||
|
||||
# elif defined(__ICCAVR__)
|
||||
# define ARCHITECTURE_ID "AVR"
|
||||
|
||||
# elif defined(__ICC430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__ICCV850__)
|
||||
# define ARCHITECTURE_ID "V850"
|
||||
|
||||
# elif defined(__ICC8051__)
|
||||
# define ARCHITECTURE_ID "8051"
|
||||
|
||||
# elif defined(__ICCSTM8__)
|
||||
# define ARCHITECTURE_ID "STM8"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__ghs__)
|
||||
# if defined(__PPC64__)
|
||||
# define ARCHITECTURE_ID "PPC64"
|
||||
|
||||
# elif defined(__ppc__)
|
||||
# define ARCHITECTURE_ID "PPC"
|
||||
|
||||
# elif defined(__ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__x86_64__)
|
||||
# define ARCHITECTURE_ID "x64"
|
||||
|
||||
# elif defined(__i386__)
|
||||
# define ARCHITECTURE_ID "X86"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
#elif defined(__TI_COMPILER_VERSION__)
|
||||
# if defined(__TI_ARM__)
|
||||
# define ARCHITECTURE_ID "ARM"
|
||||
|
||||
# elif defined(__MSP430__)
|
||||
# define ARCHITECTURE_ID "MSP430"
|
||||
|
||||
# elif defined(__TMS320C28XX__)
|
||||
# define ARCHITECTURE_ID "TMS320C28x"
|
||||
|
||||
# elif defined(__TMS320C6X__) || defined(_TMS320C6X)
|
||||
# define ARCHITECTURE_ID "TMS320C6x"
|
||||
|
||||
# else /* unknown architecture */
|
||||
# define ARCHITECTURE_ID ""
|
||||
# endif
|
||||
|
||||
# elif defined(__ADSPSHARC__)
|
||||
# define ARCHITECTURE_ID "SHARC"
|
||||
|
||||
# elif defined(__ADSPBLACKFIN__)
|
||||
# define ARCHITECTURE_ID "Blackfin"
|
||||
|
||||
#else
|
||||
# define ARCHITECTURE_ID
|
||||
#endif
|
||||
|
||||
/* Convert integer to decimal digit literals. */
|
||||
#define DEC(n) \
|
||||
('0' + (((n) / 10000000)%10)), \
|
||||
('0' + (((n) / 1000000)%10)), \
|
||||
('0' + (((n) / 100000)%10)), \
|
||||
('0' + (((n) / 10000)%10)), \
|
||||
('0' + (((n) / 1000)%10)), \
|
||||
('0' + (((n) / 100)%10)), \
|
||||
('0' + (((n) / 10)%10)), \
|
||||
('0' + ((n) % 10))
|
||||
|
||||
/* Convert integer to hex digit literals. */
|
||||
#define HEX(n) \
|
||||
('0' + ((n)>>28 & 0xF)), \
|
||||
('0' + ((n)>>24 & 0xF)), \
|
||||
('0' + ((n)>>20 & 0xF)), \
|
||||
('0' + ((n)>>16 & 0xF)), \
|
||||
('0' + ((n)>>12 & 0xF)), \
|
||||
('0' + ((n)>>8 & 0xF)), \
|
||||
('0' + ((n)>>4 & 0xF)), \
|
||||
('0' + ((n) & 0xF))
|
||||
|
||||
/* Construct a string literal encoding the version number. */
|
||||
#ifdef COMPILER_VERSION
|
||||
char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]";
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#elif defined(COMPILER_VERSION_MAJOR)
|
||||
char const info_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[',
|
||||
COMPILER_VERSION_MAJOR,
|
||||
# ifdef COMPILER_VERSION_MINOR
|
||||
'.', COMPILER_VERSION_MINOR,
|
||||
# ifdef COMPILER_VERSION_PATCH
|
||||
'.', COMPILER_VERSION_PATCH,
|
||||
# ifdef COMPILER_VERSION_TWEAK
|
||||
'.', COMPILER_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the internal version number. */
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
char const info_version_internal[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_',
|
||||
'i','n','t','e','r','n','a','l','[',
|
||||
COMPILER_VERSION_INTERNAL,']','\0'};
|
||||
#elif defined(COMPILER_VERSION_INTERNAL_STR)
|
||||
char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]";
|
||||
#endif
|
||||
|
||||
/* Construct a string literal encoding the version number components. */
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
char const info_simulate_version[] = {
|
||||
'I', 'N', 'F', 'O', ':',
|
||||
's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[',
|
||||
SIMULATE_VERSION_MAJOR,
|
||||
# ifdef SIMULATE_VERSION_MINOR
|
||||
'.', SIMULATE_VERSION_MINOR,
|
||||
# ifdef SIMULATE_VERSION_PATCH
|
||||
'.', SIMULATE_VERSION_PATCH,
|
||||
# ifdef SIMULATE_VERSION_TWEAK
|
||||
'.', SIMULATE_VERSION_TWEAK,
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
']','\0'};
|
||||
#endif
|
||||
|
||||
/* Construct the string literal in pieces to prevent the source from
|
||||
getting matched. Store it in a pointer rather than an array
|
||||
because some compilers will just produce instructions to fill the
|
||||
array rather than assigning a pointer to a static array. */
|
||||
char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]";
|
||||
char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]";
|
||||
|
||||
|
||||
|
||||
#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
|
||||
# if defined(__INTEL_CXX11_MODE__)
|
||||
# if defined(__cpp_aggregate_nsdmi)
|
||||
# define CXX_STD 201402L
|
||||
# else
|
||||
# define CXX_STD 201103L
|
||||
# endif
|
||||
# else
|
||||
# define CXX_STD 199711L
|
||||
# endif
|
||||
#elif defined(_MSC_VER) && defined(_MSVC_LANG)
|
||||
# define CXX_STD _MSVC_LANG
|
||||
#else
|
||||
# define CXX_STD __cplusplus
|
||||
#endif
|
||||
|
||||
const char* info_language_standard_default = "INFO" ":" "standard_default["
|
||||
#if CXX_STD > 202002L
|
||||
"23"
|
||||
#elif CXX_STD > 201703L
|
||||
"20"
|
||||
#elif CXX_STD >= 201703L
|
||||
"17"
|
||||
#elif CXX_STD >= 201402L
|
||||
"14"
|
||||
#elif CXX_STD >= 201103L
|
||||
"11"
|
||||
#else
|
||||
"98"
|
||||
#endif
|
||||
"]";
|
||||
|
||||
const char* info_language_extensions_default = "INFO" ":" "extensions_default["
|
||||
#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \
|
||||
defined(__TI_COMPILER_VERSION__)) && \
|
||||
!defined(__STRICT_ANSI__)
|
||||
"ON"
|
||||
#else
|
||||
"OFF"
|
||||
#endif
|
||||
"]";
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int require = 0;
|
||||
require += info_compiler[argc];
|
||||
require += info_platform[argc];
|
||||
#ifdef COMPILER_VERSION_MAJOR
|
||||
require += info_version[argc];
|
||||
#endif
|
||||
#ifdef COMPILER_VERSION_INTERNAL
|
||||
require += info_version_internal[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_ID
|
||||
require += info_simulate[argc];
|
||||
#endif
|
||||
#ifdef SIMULATE_VERSION_MAJOR
|
||||
require += info_simulate_version[argc];
|
||||
#endif
|
||||
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
|
||||
require += info_cray[argc];
|
||||
#endif
|
||||
require += info_language_standard_default[argc];
|
||||
require += info_language_extensions_default[argc];
|
||||
(void)argv;
|
||||
return require;
|
||||
}
|
||||
Binary file not shown.
|
|
@ -0,0 +1 @@
|
|||
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
|
||||
|
|
@ -0,0 +1 @@
|
|||
ref: refs/heads/master
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
#
|
||||
# Internal file for GetGitRevisionDescription.cmake
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/git-data/HEAD" HEAD_CONTENTS LIMIT 1024)
|
||||
|
||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||
set(GIT_DIR "C:/Zendion Inc/agrobot_base/.git")
|
||||
# handle git-worktree
|
||||
if(EXISTS "${GIT_DIR}/commondir")
|
||||
file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024)
|
||||
string(STRIP "${GIT_DIR_NEW}" GIT_DIR_NEW)
|
||||
if(NOT IS_ABSOLUTE "${GIT_DIR_NEW}")
|
||||
get_filename_component(GIT_DIR_NEW ${GIT_DIR}/${GIT_DIR_NEW} ABSOLUTE)
|
||||
endif()
|
||||
if(EXISTS "${GIT_DIR_NEW}")
|
||||
set(GIT_DIR "${GIT_DIR_NEW}")
|
||||
endif()
|
||||
endif()
|
||||
if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "${GIT_DIR}/${HEAD_REF}")
|
||||
configure_file("${GIT_DIR}/${HEAD_REF}" "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/git-data/head-ref" COPYONLY)
|
||||
elseif(EXISTS "${GIT_DIR}/logs/${HEAD_REF}")
|
||||
configure_file("${GIT_DIR}/logs/${HEAD_REF}" "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/git-data/head-ref" COPYONLY)
|
||||
set(HEAD_HASH "${HEAD_REF}")
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
configure_file("${GIT_DIR}/HEAD" "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/git-data/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
file(READ "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/git-data/head-ref" HEAD_HASH LIMIT 1024)
|
||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||
endif()
|
||||
|
|
@ -0,0 +1 @@
|
|||
cf028c6c4e95d04b1c4c5057f123fc0bb5c5626e
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"COMPONENT_KCONFIGS": "C:/Users/Grão de Gente - TI/esp/esp-idf/components/app_trace/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/bt/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/driver/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/efuse/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp-tls/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_adc/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_coex/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_common/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_eth/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_event/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_gdbstub/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_http_client/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_http_server/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_https_ota/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_https_server/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_hw_support/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_lcd/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_netif/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_partition/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_phy/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_pm/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_psram/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_ringbuf/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_system/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_timer/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_wifi/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/espcoredump/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/fatfs/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/freertos/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/hal/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/heap/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/ieee802154/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/log/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/lwip/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/mbedtls/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/mqtt/esp-mqtt/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/newlib/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/nvs_flash/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/openthread/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/protocomm/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/pthread/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/soc/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/spi_flash/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/spiffs/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/tcp_transport/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/ulp/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/unity/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/usb/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/vfs/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/wear_levelling/Kconfig;C:/Users/Grão de Gente - TI/esp/esp-idf/components/wifi_provisioning/Kconfig",
|
||||
"COMPONENT_KCONFIGS_PROJBUILD": "C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/Kconfig.projbuild;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_app_format/Kconfig.projbuild;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_rom/Kconfig.projbuild;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esptool_py/Kconfig.projbuild;C:/Users/Grão de Gente - TI/esp/esp-idf/components/partition_table/Kconfig.projbuild;C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/main/Kconfig.projbuild",
|
||||
"COMPONENT_SDKCONFIG_RENAMES": "C:/Users/Grão de Gente - TI/esp/esp-idf/components/app_trace/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/bt/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/driver/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_coex/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_event/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_gdbstub/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_https_ota/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_hw_support/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_hw_support/sdkconfig.rename.esp32;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_phy/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_pm/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_system/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_system/sdkconfig.rename.esp32;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_timer/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_wifi/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/espcoredump/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/esptool_py/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/freertos/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/hal/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/lwip/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/newlib/sdkconfig.rename.esp32;C:/Users/Grão de Gente - TI/esp/esp-idf/components/pthread/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/spi_flash/sdkconfig.rename;C:/Users/Grão de Gente - TI/esp/esp-idf/components/ulp/sdkconfig.rename.esp32;C:/Users/Grão de Gente - TI/esp/esp-idf/components/vfs/sdkconfig.rename",
|
||||
"IDF_TARGET": "esp32",
|
||||
"IDF_ENV_FPGA": "",
|
||||
"IDF_PATH": "C:/Users/Grão de Gente - TI/esp/esp-idf",
|
||||
"COMPONENT_KCONFIGS_SOURCE_FILE": "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/kconfigs.in",
|
||||
"COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE": "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/kconfigs_projbuild.in"
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/app_trace/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/bt/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/driver/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/efuse/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp-tls/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_adc/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_coex/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_common/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_eth/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_event/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_gdbstub/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_http_client/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_http_server/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_https_ota/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_https_server/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_hw_support/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_lcd/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_netif/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_partition/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_phy/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_pm/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_psram/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_ringbuf/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_system/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_timer/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_wifi/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/espcoredump/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/fatfs/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/freertos/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/hal/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/heap/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/ieee802154/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/log/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/lwip/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/mbedtls/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/mqtt/esp-mqtt/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/newlib/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/nvs_flash/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/openthread/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/protocomm/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/pthread/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/soc/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/spi_flash/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/spiffs/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/tcp_transport/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/ulp/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/unity/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/usb/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/vfs/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/wear_levelling/Kconfig"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/wifi_provisioning/Kconfig"
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/Kconfig.projbuild"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_app_format/Kconfig.projbuild"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esp_rom/Kconfig.projbuild"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/esptool_py/Kconfig.projbuild"
|
||||
source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/partition_table/Kconfig.projbuild"
|
||||
source "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/main/Kconfig.projbuild"
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
Traceback (most recent call last):
|
||||
File "<frozen runpy>", line 198, in _run_module_as_main
|
||||
File "<frozen runpy>", line 88, in _run_code
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfgen\__main__.py", line 16, in <module>
|
||||
main()
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfgen\core.py", line 319, in main
|
||||
config = kconfiglib.Kconfig(args.kconfig)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 947, in __init__
|
||||
self._init(filename, warn, warn_to_stderr, encoding)
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 1085, in _init
|
||||
self._parse_block(None, self.top_node, self.top_node).next = None
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 2989, in _parse_block
|
||||
prev = self._parse_block(None, parent, prev)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 2977, in _parse_block
|
||||
raise KconfigError(
|
||||
kconfiglib.KconfigError: C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/kconfigs_projbuild.in:1: 'C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/Kconfig.projbuild' not found (in 'source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/Kconfig.projbuild"'). Check that environment variables are set correctly (e.g. $srctree, which is unset or blank). Also note that unset environment variables expand to the empty string.
|
||||
CMake Error at C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/kconfig.cmake:176 (message):
|
||||
Failed to run kconfgen
|
||||
(C:/Espressif/python_env/idf5.1_py3.11_env/Scripts/python.exe;-m;kconfgen;--list-separator=semicolon;--kconfig;C:/Users/Grão
|
||||
de Gente - TI/esp/esp-idf/Kconfig;--sdkconfig-rename;C:/Users/Grão de
|
||||
Gente - TI/esp/esp-idf/sdkconfig.rename;--config;C:/Zendion
|
||||
Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/sdkconfig;--env-file;C:/Zendion
|
||||
Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/config.env). Error 1
|
||||
Call Stack (most recent call first):
|
||||
C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/build.cmake:611 (__kconfig_generate_config)
|
||||
C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
|
||||
CMakeLists.txt:6 (project)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
Traceback (most recent call last):
|
||||
File "<frozen runpy>", line 198, in _run_module_as_main
|
||||
File "<frozen runpy>", line 88, in _run_code
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfgen\__main__.py", line 16, in <module>
|
||||
main()
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfgen\core.py", line 319, in main
|
||||
config = kconfiglib.Kconfig(args.kconfig)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 947, in __init__
|
||||
self._init(filename, warn, warn_to_stderr, encoding)
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 1085, in _init
|
||||
self._parse_block(None, self.top_node, self.top_node).next = None
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 2989, in _parse_block
|
||||
prev = self._parse_block(None, parent, prev)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Espressif\python_env\idf5.1_py3.11_env\Lib\site-packages\kconfiglib.py", line 2977, in _parse_block
|
||||
raise KconfigError(
|
||||
kconfiglib.KconfigError: C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/kconfigs_projbuild.in:1: 'C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/Kconfig.projbuild' not found (in 'source "C:/Users/Grão de Gente - TI/esp/esp-idf/components/bootloader/Kconfig.projbuild"'). Check that environment variables are set correctly (e.g. $srctree, which is unset or blank). Also note that unset environment variables expand to the empty string.
|
||||
CMake Error at C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/kconfig.cmake:176 (message):
|
||||
Failed to run kconfgen
|
||||
(C:/Espressif/python_env/idf5.1_py3.11_env/Scripts/python.exe;-m;kconfgen;--list-separator=semicolon;--kconfig;C:/Users/Grão
|
||||
de Gente - TI/esp/esp-idf/Kconfig;--sdkconfig-rename;C:/Users/Grão de
|
||||
Gente - TI/esp/esp-idf/sdkconfig.rename;--config;C:/Zendion
|
||||
Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/sdkconfig;--env-file;C:/Zendion
|
||||
Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/config.env). Error 1
|
||||
Call Stack (most recent call first):
|
||||
C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/build.cmake:611 (__kconfig_generate_config)
|
||||
C:/Users/Grão de Gente - TI/esp/esp-idf/tools/cmake/project.cmake:547 (idf_build_process)
|
||||
CMakeLists.txt:6 (project)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
-- Found Git: C:/Espressif/tools/idf-git/2.39.2/cmd/git.exe (found version "2.39.2.windows.1")
|
||||
-- ccache will be used for faster recompilation
|
||||
-- The C compiler identification is GNU 12.2.0
|
||||
-- The CXX compiler identification is GNU 12.2.0
|
||||
-- The ASM compiler identification is GNU
|
||||
-- Found assembler: C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - done
|
||||
-- Check for working C compiler: C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
|
||||
-- Detecting C compile features
|
||||
-- Detecting C compile features - done
|
||||
-- Detecting CXX compiler ABI info
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Check for working CXX compiler: C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe - skipped
|
||||
-- Detecting CXX compile features
|
||||
-- Detecting CXX compile features - done
|
||||
-- Building ESP-IDF components for target esp32
|
||||
Dependencies lock doesn't exist, solving dependencies.
|
||||
...Updating lock file at C:\Zendion Inc\agrobot_base\Firmware\ESP\AgroboticsMOV\dependencies.lock
|
||||
Processing 2 dependencies:
|
||||
[1/2] espressif/led_strip (2.4.3)
|
||||
[2/2] idf (5.1.1)
|
||||
-- Project sdkconfig file C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/sdkconfig
|
||||
-- Configuring incomplete, errors occurred!
|
||||
See also "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/CMakeOutput.log".
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
-- Found Git: C:/Espressif/tools/idf-git/2.39.2/cmd/git.exe (found version "2.39.2.windows.1")
|
||||
-- ccache will be used for faster recompilation
|
||||
-- The C compiler identification is GNU 12.2.0
|
||||
-- The CXX compiler identification is GNU 12.2.0
|
||||
-- The ASM compiler identification is GNU
|
||||
-- Found assembler: C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
|
||||
-- Detecting C compiler ABI info
|
||||
-- Detecting C compiler ABI info - done
|
||||
-- Check for working C compiler: C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
|
||||
-- Detecting C compile features
|
||||
-- Detecting C compile features - done
|
||||
-- Detecting CXX compiler ABI info
|
||||
-- Detecting CXX compiler ABI info - done
|
||||
-- Check for working CXX compiler: C:/Espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe - skipped
|
||||
-- Detecting CXX compile features
|
||||
-- Detecting CXX compile features - done
|
||||
-- Building ESP-IDF components for target esp32
|
||||
Processing 2 dependencies:
|
||||
[1/2] espressif/led_strip (2.4.3)
|
||||
[2/2] idf (5.1.1)
|
||||
-- Project sdkconfig file C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/sdkconfig
|
||||
-- Configuring incomplete, errors occurred!
|
||||
See also "C:/Zendion Inc/agrobot_base/Firmware/ESP/AgroboticsMOV/build/CMakeFiles/CMakeOutput.log".
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
dependencies:
|
||||
espressif/led_strip:
|
||||
component_hash: c240f82567a37357bef313f76b0df93cb2da025835e525006096ea7e0fd61b4f
|
||||
source:
|
||||
service_url: https://api.components.espressif.com/
|
||||
type: service
|
||||
version: 2.4.3
|
||||
idf:
|
||||
component_hash: null
|
||||
source:
|
||||
type: idf
|
||||
version: 5.1.1
|
||||
manifest_hash: 4c7ed8e6f874750f820a5ffeddfcacf4689c12b7a80aa1ade7cd3f7d7a7121a1
|
||||
target: esp32
|
||||
version: 1.0.0
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
idf_component_register(SRCS "blink_example_main.c"
|
||||
INCLUDE_DIRS ".")
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
menu "Example Configuration"
|
||||
|
||||
orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps"
|
||||
|
||||
choice BLINK_LED
|
||||
prompt "Blink LED type"
|
||||
default BLINK_LED_GPIO if IDF_TARGET_ESP32 || !SOC_RMT_SUPPORTED
|
||||
default BLINK_LED_RMT
|
||||
help
|
||||
Defines the default peripheral for blink example
|
||||
|
||||
config BLINK_LED_GPIO
|
||||
bool "GPIO"
|
||||
config BLINK_LED_RMT
|
||||
bool "RMT - Addressable LED"
|
||||
endchoice
|
||||
|
||||
config BLINK_GPIO
|
||||
int "Blink GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||
default 5 if IDF_TARGET_ESP32
|
||||
default 18 if IDF_TARGET_ESP32S2
|
||||
default 48 if IDF_TARGET_ESP32S3
|
||||
default 8
|
||||
help
|
||||
GPIO number (IOxx) to blink on and off or the RMT signal for the addressable LED.
|
||||
Some GPIOs are used for other purposes (flash connections, etc.) and cannot be used to blink.
|
||||
|
||||
config BLINK_PERIOD
|
||||
int "Blink period in ms"
|
||||
range 10 3600000
|
||||
default 1000
|
||||
help
|
||||
Define the blinking period in milliseconds.
|
||||
|
||||
endmenu
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
/* Blink Example
|
||||
|
||||
This example code is in the Public Domain (or CC0 licensed, at your option.)
|
||||
|
||||
Unless required by applicable law or agreed to in writing, this
|
||||
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "driver/gpio.h"
|
||||
#include "esp_log.h"
|
||||
#include "led_strip.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
static const char *TAG = "example";
|
||||
|
||||
/* Use project configuration menu (idf.py menuconfig) to choose the GPIO to blink,
|
||||
or you can edit the following line and set a number here.
|
||||
*/
|
||||
#define BLINK_GPIO CONFIG_BLINK_GPIO
|
||||
|
||||
static uint8_t s_led_state = 0;
|
||||
|
||||
#ifdef CONFIG_BLINK_LED_RMT
|
||||
|
||||
static led_strip_handle_t led_strip;
|
||||
|
||||
static void blink_led(void)
|
||||
{
|
||||
/* If the addressable LED is enabled */
|
||||
if (s_led_state) {
|
||||
/* Set the LED pixel using RGB from 0 (0%) to 255 (100%) for each color */
|
||||
led_strip_set_pixel(led_strip, 0, 16, 16, 16);
|
||||
/* Refresh the strip to send data */
|
||||
led_strip_refresh(led_strip);
|
||||
} else {
|
||||
/* Set all LED off to clear all pixels */
|
||||
led_strip_clear(led_strip);
|
||||
}
|
||||
}
|
||||
|
||||
static void configure_led(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "Example configured to blink addressable LED!");
|
||||
/* LED strip initialization with the GPIO and pixels number*/
|
||||
led_strip_config_t strip_config = {
|
||||
.strip_gpio_num = BLINK_GPIO,
|
||||
.max_leds = 1, // at least one LED on board
|
||||
};
|
||||
led_strip_rmt_config_t rmt_config = {
|
||||
.resolution_hz = 10 * 1000 * 1000, // 10MHz
|
||||
};
|
||||
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
|
||||
/* Set all LED off to clear all pixels */
|
||||
led_strip_clear(led_strip);
|
||||
}
|
||||
|
||||
#elif CONFIG_BLINK_LED_GPIO
|
||||
|
||||
static void blink_led(void)
|
||||
{
|
||||
/* Set the GPIO level according to the state (LOW or HIGH)*/
|
||||
gpio_set_level(BLINK_GPIO, s_led_state);
|
||||
}
|
||||
|
||||
static void configure_led(void)
|
||||
{
|
||||
ESP_LOGI(TAG, "Example configured to blink GPIO LED!");
|
||||
gpio_reset_pin(BLINK_GPIO);
|
||||
/* Set the GPIO as a push/pull output */
|
||||
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
|
||||
/* Configure the peripheral according to the LED type */
|
||||
configure_led();
|
||||
|
||||
while (1) {
|
||||
ESP_LOGI(TAG, "Turning the LED %s!", s_led_state == true ? "ON" : "OFF");
|
||||
blink_led();
|
||||
/* Toggle the LED state */
|
||||
s_led_state = !s_led_state;
|
||||
vTaskDelay(CONFIG_BLINK_PERIOD / portTICK_PERIOD_MS);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
espressif/led_strip: "^2.0.0"
|
||||
|
|
@ -0,0 +1 @@
|
|||
c240f82567a37357bef313f76b0df93cb2da025835e525006096ea7e0fd61b4f
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
## 2.4.0
|
||||
|
||||
- Support configurable SPI mode to contorl leds
|
||||
- recommend to enable DMA when using SPI mode
|
||||
|
||||
## 2.3.0
|
||||
|
||||
- Support configurable RMT channel size by setting `mem_block_symbols`
|
||||
|
||||
## 2.2.0
|
||||
|
||||
- Support for 4 components RGBW leds (SK6812):
|
||||
- in led_strip_config_t new fields
|
||||
led_pixel_format, controlling byte format (LED_PIXEL_FORMAT_GRB, LED_PIXEL_FORMAT_GRBW)
|
||||
led_model, used to configure bit timing (LED_MODEL_WS2812, LED_MODEL_SK6812)
|
||||
- new API led_strip_set_pixel_rgbw
|
||||
- new interface type set_pixel_rgbw
|
||||
|
||||
## 2.1.0
|
||||
|
||||
- Support DMA feature, which offloads the CPU by a lot when it comes to drive a bunch of LEDs
|
||||
- Support various RMT clock sources
|
||||
- Acquire and release the power management lock before and after each refresh
|
||||
- New driver flag: `invert_out` which can invert the led control signal by hardware
|
||||
|
||||
## 2.0.0
|
||||
|
||||
- Reimplemented the driver using the new RMT driver (`driver/rmt_tx.h`)
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Initial driver version, based on the legacy RMT driver (`driver/rmt.h`)
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
include($ENV{IDF_PATH}/tools/cmake/version.cmake)
|
||||
|
||||
set(srcs "src/led_strip_api.c")
|
||||
|
||||
if(CONFIG_SOC_RMT_SUPPORTED)
|
||||
list(APPEND srcs "src/led_strip_rmt_dev.c" "src/led_strip_rmt_encoder.c")
|
||||
endif()
|
||||
|
||||
# the SPI backend driver relies on something that was added in IDF 5.1
|
||||
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.1")
|
||||
if(CONFIG_SOC_GPSPI_SUPPORTED)
|
||||
list(APPEND srcs "src/led_strip_spi_dev.c")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
idf_component_register(SRCS ${srcs}
|
||||
INCLUDE_DIRS "include" "interface"
|
||||
REQUIRES "driver")
|
||||
|
|
@ -0,0 +1,202 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
# LED Strip Driver
|
||||
|
||||
[](https://components.espressif.com/components/espressif/led_strip)
|
||||
|
||||
This driver is designed for addressable LEDs like [WS2812](http://www.world-semi.com/Certifications/WS2812B.html), where each LED is controlled by a single data line.
|
||||
|
||||
## Backend Controllers
|
||||
|
||||
### The [RMT](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/rmt.html) Peripheral
|
||||
|
||||
This is the most economical way to drive the LEDs because it only consumes one RMT channel, leaving other channels free to use. However, the memory usage increases dramatically with the number of LEDs. If the RMT hardware can't be assist by DMA, the driver will going into interrupt very frequently, thus result in a high CPU usage. What's worse, if the RMT interrupt is delayed or not serviced in time (e.g. if Wi-Fi interrupt happens on the same CPU core), the RMT transaction will be corrupted and the LEDs will display incorrect colors. If you want to use RMT to drive a large number of LEDs, you'd better to enable the DMA feature if possible [^1].
|
||||
|
||||
#### Allocate LED Strip Object with RMT Backend
|
||||
|
||||
```c
|
||||
#define BLINK_GPIO 0
|
||||
|
||||
led_strip_handle_t led_strip;
|
||||
|
||||
/* LED strip initialization with the GPIO and pixels number*/
|
||||
led_strip_config_t strip_config = {
|
||||
.strip_gpio_num = BLINK_GPIO, // The GPIO that connected to the LED strip's data line
|
||||
.max_leds = 1, // The number of LEDs in the strip,
|
||||
.led_pixel_format = LED_PIXEL_FORMAT_GRB, // Pixel format of your LED strip
|
||||
.led_model = LED_MODEL_WS2812, // LED strip model
|
||||
.flags.invert_out = false, // whether to invert the output signal (useful when your hardware has a level inverter)
|
||||
};
|
||||
|
||||
led_strip_rmt_config_t rmt_config = {
|
||||
.clk_src = RMT_CLK_SRC_DEFAULT, // different clock source can lead to different power consumption
|
||||
.resolution_hz = 10 * 1000 * 1000, // 10MHz
|
||||
.flags.with_dma = false, // whether to enable the DMA feature
|
||||
};
|
||||
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
|
||||
```
|
||||
|
||||
You can create multiple LED strip objects with different GPIOs and pixel numbers. The backend driver will automatically allocate the RMT channel for you if there is more available.
|
||||
|
||||
### The [SPI](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/spi_master.html) Peripheral
|
||||
|
||||
SPI peripheral can also be used to generate the timing required by the LED strip. However this backend is not as economical as the RMT one, because it will take up the whole **bus**, unlike the RMT just takes one **channel**. You **CANT** connect other devices to the same SPI bus if it's been used by the led_strip, because the led_strip doesn't have the concept of "Chip Select".
|
||||
|
||||
Please note, the SPI backend has a dependency of **ESP-IDF >= 5.1**
|
||||
|
||||
#### Allocate LED Strip Object with SPI Backend
|
||||
|
||||
```c
|
||||
#define BLINK_GPIO 0
|
||||
|
||||
led_strip_handle_t led_strip;
|
||||
|
||||
/* LED strip initialization with the GPIO and pixels number*/
|
||||
led_strip_config_t strip_config = {
|
||||
.strip_gpio_num = BLINK_GPIO, // The GPIO that connected to the LED strip's data line
|
||||
.max_leds = 1, // The number of LEDs in the strip,
|
||||
.led_pixel_format = LED_PIXEL_FORMAT_GRB, // Pixel format of your LED strip
|
||||
.led_model = LED_MODEL_WS2812, // LED strip model
|
||||
.flags.invert_out = false, // whether to invert the output signal (useful when your hardware has a level inverter)
|
||||
};
|
||||
|
||||
led_strip_spi_config_t spi_config = {
|
||||
.clk_src = SPI_CLK_SRC_DEFAULT, // different clock source can lead to different power consumption
|
||||
.flags.with_dma = true, // Using DMA can improve performance and help drive more LEDs
|
||||
.spi_bus = SPI2_HOST, // SPI bus ID
|
||||
};
|
||||
ESP_ERROR_CHECK(led_strip_new_spi_device(&strip_config, &spi_config, &led_strip));
|
||||
```
|
||||
|
||||
The number of LED strip objects can be created depends on how many free SPI buses are free to use in your project.
|
||||
|
||||
## FAQ
|
||||
|
||||
* Which led_strip backend should I choose?
|
||||
* It depends on your application requirement and target chip's ability.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A{Is RMT supported?}
|
||||
A --> |No| B[SPI backend]
|
||||
B --> C{Does the led strip has \n a larger number of LEDs?}
|
||||
C --> |No| D[Don't have to enable the DMA of the backend]
|
||||
C --> |Yes| E[Enable the DMA of the backend]
|
||||
A --> |Yes| F{Does the led strip has \n a larger number of LEDs?}
|
||||
F --> |Yes| G{Does RMT support DMA?}
|
||||
G --> |Yes| E
|
||||
G --> |No| B
|
||||
F --> |No| H[RMT backend] --> D
|
||||
```
|
||||
|
||||
[^1]: The RMT DMA feature is not available on all ESP chips. Please check the data sheet before using it.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue