cat /proc/cpuinfo
Hardware : BCM2708 Revision : 000e Serial : 00000000bf257857
像手上這塊板子是000e,則可以知道是Model B 2.0、記憶體是512MB,由Sony製造。
表格資訊會隨時間持續增加項目,最新資料可到elinux.org查詢。
cat /proc/cpuinfo
Hardware : BCM2708 Revision : 000e Serial : 00000000bf257857
1 | sudo apt-get install gcc-arm-linux-gnueabi |
1 2 3 4 5 6 | #include <stdio.h> int main(int argc, char *argv[]) { printf("Hello Raspberry Pi!\n"); } |
1 | arm-linux-gnueabi-gcc -o hello hello.c |
1>Source.obj : error LNK2001: 無法解析的外部符號 __imp__PathFileExistsA@4 1>E:\Tmp\ConsoleApplication13\Release\ConsoleApplication13.exe : fatal error LNK1120: 1 個無法解析的外部符號 1> 1>建置失敗。
#pragma comment(lib, "Shlwapi.lib")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | class CheckBoxTriState : CheckBox { public CheckBoxTriState() { ThreeState = true; CheckState = System.Windows.Forms.CheckState.Indeterminate; Text = String.Empty; Size = new Size(20, 40); } protected override void OnPaint(PaintEventArgs pevent) { Graphics g = pevent.Graphics; g.Clear(Color.LightGray); Brush b = new SolidBrush(Color.DarkGray); g.DrawRectangle(new Pen(b), 0, 0, Width, Height); float radius = (float)(Width * 0.9); float margin = (float)(Width * 0.05); if (CheckState == System.Windows.Forms.CheckState.Indeterminate) g.FillEllipse(b, margin, (float)(Height / 4.0) + margin, radius, radius); else if (CheckState == System.Windows.Forms.CheckState.Checked) g.FillEllipse(b, margin, margin, radius, radius); else g.FillEllipse(b, margin, (float)(Height / 2.0 - margin), radius, radius); } protected override void OnClick(EventArgs e) { Point pos = this.PointToClient(Cursor.Position); if (pos.Y < Height / 3) CheckState = System.Windows.Forms.CheckState.Checked; else if (pos.Y > Height * 2 / 3) CheckState = System.Windows.Forms.CheckState.Unchecked; else CheckState = System.Windows.Forms.CheckState.Indeterminate; } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public partial class Form1 : Form { public Form1() { InitializeComponent(); CheckBoxTriState check = new CheckBoxTriState(); check.Location = new Point(10, 10); Controls.Add(check); CheckBoxTriState check2 = new CheckBoxTriState(); check2.Location = new Point(40, 10); check2.CheckState = CheckState.Checked; Controls.Add(check2); CheckBoxTriState check3 = new CheckBoxTriState(); check3.Location = new Point(70, 10); check3.CheckState = CheckState.Unchecked; Controls.Add(check3); } } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | class CheckBoxEx : CheckBox { public CheckBoxEx() { } public override string Text { get { return base.Text; } set { base.Text = value; Size size = TextRenderer.MeasureText(value, Font); if (Width < size.Width + ClientSize.Height) Width = size.Width + ClientSize.Height; } } public override Font Font { get { return base.Font; } set { base.Font = value; Size size = TextRenderer.MeasureText(Text, value); if (Width < size.Width + ClientSize.Height) Width = size.Width + ClientSize.Height; } } protected override void OnPaint(PaintEventArgs e) { int h = ClientSize.Height; Rectangle rc = new Rectangle(new Point(0, 0), new Size(h, h)); e.Graphics.Clear(Parent.BackColor); ControlPaint.DrawCheckBox(e.Graphics, rc, this.Checked ? ButtonState.Checked : ButtonState.Normal); SizeF size = e.Graphics.MeasureString(Text, Font); e.Graphics.DrawString(Text, this.Font, new SolidBrush(Color.Blue), new PointF(h, size.Height < h ? (h - size.Height) / 2 : 0)); } } |
1 2 3 4 5 6 | CheckBoxEx check = new CheckBoxEx(); check.Location = new Point(40, 40); check.ClientSize = new Size(30, 30); check.Text = "Hello CheckBox"; check.Font = new System.Drawing.Font("新細明體", 18); Controls.Add(check); |
1 | petalinux-create -t apps --template install --name autostart |
1 2 3 4 5 6 7 8 | install: # Please add commands below the comments to install data to target file system. # Use $(TARGETINST) to copy data into the target # E.g. there is data/acos_install in the current directory, and I want to # copy it into the target "/" directory: #$(TARGETINST) -d data/acos_install /acos_install $(TARGETINST) -d -p 0755 autologin.sh /home/autologin.sh $(TARGETINST) -d -p 0755 inittab /etc/inittab |
1 | petalinux-config -c rootfs |
1 | petalinux-build |
1 | sudo dpkg-reconfigure dash |