Skip to content

Commit 3544e08

Browse files
author
Kristoffer Andersen
committed
version 0.9 of arduino env.
Removed auto dimming New monoprog version with serial port added deployment script
1 parent b96d93f commit 3544e08

File tree

9 files changed

+193
-82
lines changed

9 files changed

+193
-82
lines changed

mono/cores/arduino/app_controller.cpp

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99
#include "app_controller.h"
1010
#include "Arduino.h"
1111

12+
AppController *AppController::ArduinoAppController = 0;
13+
1214
AppController::AppController() :
1315
bg(mono::display::BlackColor),
1416
ard(mono::geo::Rect(0,100,172,35), "Arduino")
1517
{
18+
AppController::ArduinoAppController = this;
1619
ard.setAlignment(mono::ui::TextLabelView::ALIGN_CENTER);
1720
ard.setTextColor(mono::display::WhiteColor);
1821
ard.setBackgroundColor(mono::display::BlackColor);
1922
ard.setTextSize(2);
23+
2024
this->singleShot = false;
2125
}
2226

@@ -26,32 +30,14 @@ void AppController::monoWakeFromReset()
2630
ard.show();
2731

2832
mono::IApplicationContext::Instance->DisplayController->setBrightness(128);
29-
mono::IApplicationContext::Instance->RunLoop->addDynamicTask(this);
33+
mono::IApplicationContext::Instance->RunLoop->addDynamicTask(this);
3034

31-
ardTimer.attach<AppController>(this, &AppController::ardTimerFire, 3);
32-
33-
setup();
35+
setup();
3436
}
3537

3638
void AppController::taskHandler()
3739
{
38-
loop();
39-
}
40-
41-
void AppController::ardTimerFire()
42-
{
43-
mono::display::IDisplayController *ctrl = mono::IApplicationContext::Instance->DisplayController;
44-
45-
if (ctrl->Brightness() <= 10)
46-
{
47-
ardTimer.detach();
48-
ctrl->setBrightness(10);
49-
}
50-
else
51-
{
52-
ctrl->setBrightness(ctrl->Brightness() - 2);
53-
ardTimer.attach_us<AppController>(this, &AppController::ardTimerFire, 20000);
54-
}
40+
loop();
5541
}
5642

5743
void AppController::monoWillGotoSleep()

mono/cores/arduino/app_controller.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,21 @@ class AppController : public mono::IApplication, mono::IRunLoopTask {
1616

1717
mono::ui::BackgroundView bg;
1818
mono::ui::TextLabelView ard;
19-
mbed::Ticker ardTimer;
20-
21-
void taskHandler();
19+
20+
void taskHandler();
2221

2322
public:
2423

25-
AppController();
24+
static AppController *ArduinoAppController;
2625

27-
void ardTimerFire();
26+
AppController();
2827

29-
void ardTimerBlink();
30-
3128
void monoWakeFromReset();
3229

3330
void monoWillGotoSleep();
3431

3532
void monoWakeFromSleep();
36-
37-
33+
3834
};
3935

4036
#endif /* app_controller_h */

mono/platform.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ldFlags= -g -mcpu=cortex-m3 -mthumb -march=armv7-m -fno-rtti -Wl,--gc-sections -
99

1010
monoPath={runtime.platform.path}/cores/arduino/mono/include
1111
includeMbed=-I{monoPath}/mbed -I{monoPath}/mbed/api -I{monoPath}/mbed/hal -I{monoPath}/mbed/target_cypress
12-
monoIncludes={includeMbed} -I{monoPath}/ -I{monoPath}/display -I{monoPath}/display/ui -I{monoPath}/display/ili9225g -I{monoPath}/media -I{monoPath}/wireless -I{runtime.platform.path}/arduino
12+
monoIncludes={includeMbed} -I{monoPath} -I{monoPath}/display -I{monoPath}/display/ui -I{monoPath}/display/ili9225g -I{monoPath}/media -I{monoPath}/wireless -I{runtime.platform.path}/arduino
1313

1414
frameworks={runtime.platform.path}/cores/arduino/mono/monoCyLib.a {runtime.platform.path}/cores/arduino/mono/CyComponentLibrary.a {runtime.platform.path}/cores/arduino/mono/mbedlib.a {runtime.platform.path}/cores/arduino/mono/mono_framework.a
1515

@@ -55,7 +55,7 @@ recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -D
5555
recipe.S.o.pattern="{compiler.path}{compiler.S.cmd}" {compiler.c.flags} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {build.extra_flags} {monoIncludes} "{source_file}" -o "{object_file}"
5656

5757
## Create archives
58-
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}"
58+
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{archive_file_path}" "{object_file}"
5959

6060
## Combine gc-sections, archives, and objects
6161
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" -Wl,--start-group {ldFlags} -o "{build.path}/{build.project_name}.elf" {frameworks} {build.path}/{archive_file} {object_files} -mfix-cortex-m3-ldrd "-Wl,-Map,{build.path}/mono_project.map" -T {build.ldscript} -g "-u\ _printf_float" {sysLibs} -Wl,--gc-sections -Wl,--end-group
@@ -67,8 +67,8 @@ recipe.size.regex=\.text\s+([0-9]+).*
6767
# MONOPROG
6868

6969
tools.monoprog.path={runtime.tools.monoprog.path}
70-
tools.monoprog.cmd=run.sh
71-
tools.monoprog.cmd.windows=run.bat
70+
tools.monoprog.cmd=monoprog.app/Contents/MacOS/monoprog
71+
tools.monoprog.cmd.windows=monoprog.exe
7272
tools.monoprog.upload.params.verbose=1
7373
tools.monoprog.upload.params.quiet=0
7474
tools.monoprog.upload.pattern="{path}/{cmd}" {runtime.tools.monoprog.path} --verbose={upload.verbose} -p "{build.path}/{build.project_name}.elf"

monoprog/reboot.py

Lines changed: 0 additions & 31 deletions
This file was deleted.

monoprog/run.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

monoprog_win/USBUART_cdc.inf

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
;******************************************************************************
2+
; File Name: USBUART_cdc.inf
3+
; Version 2.80
4+
;
5+
; Description:
6+
; Windows USB CDC setup file for USBUART Device.
7+
;
8+
;******************************************************************************
9+
; Copyright 2007-2014, Cypress Semiconductor Corporation. All rights reserved.
10+
; You may use this file only in accordance with the license, terms, conditions,
11+
; disclaimers, and limitations in the end user license agreement accompanying
12+
; the software package with which this file was provided.
13+
;******************************************************************************
14+
15+
[Version]
16+
Signature="$Windows NT$"
17+
Class=Ports
18+
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
19+
Provider=%PROVIDER%
20+
LayoutFile=layout.inf
21+
DriverVer=03/05/2007,2.0.0000.0
22+
23+
[Manufacturer]
24+
%MFGNAME%=DeviceList, NTx86, NTia64, NTamd64
25+
26+
[DestinationDirs]
27+
DefaultDestDir=12
28+
29+
[SourceDisksFiles]
30+
31+
[SourceDisksNames]
32+
33+
[DeviceList.NTx86]
34+
%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232
35+
36+
[DeviceList.NTia64]
37+
%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232
38+
39+
[DeviceList.NTamd64]
40+
%DESCRIPTION%=DriverInstall, USB\VID_04B4&PID_F232
41+
42+
43+
;------------------------------------------------------------------------------
44+
; 32 bit section for Windows 2000/2003/XP/Vista
45+
;------------------------------------------------------------------------------
46+
47+
[DriverInstall.NTx86]
48+
include=mdmcpq.inf
49+
CopyFiles=DriverCopyFiles
50+
AddReg=DriverInstall.NTx86.AddReg
51+
52+
[DriverCopyFiles]
53+
usbser.sys,,,0x20
54+
55+
[DriverInstall.NTx86.AddReg]
56+
HKR,,DevLoader,,*ntkern
57+
HKR,,NTMPDriver,,usbser.sys
58+
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
59+
60+
[DriverInstall.NTx86.Services]
61+
AddService=usbser, 0x00000002, DriverService
62+
63+
;------------------------------------------------------------------------------
64+
; 64 bit section for Intel Itanium based systems
65+
;------------------------------------------------------------------------------
66+
67+
[DriverInstall.NTia64]
68+
include=mdmcpq.inf
69+
CopyFiles=DriverCopyFiles
70+
AddReg=DriverInstall.NTia64.AddReg
71+
72+
[DriverCopyFiles]
73+
usbser.sys,,,0x20
74+
75+
[DriverInstall.NTia64.AddReg]
76+
HKR,,DevLoader,,*ntkern
77+
HKR,,NTMPDriver,,usbser.sys
78+
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
79+
80+
[DriverInstall.NTia64.Services]
81+
AddService=usbser, 0x00000002, DriverService
82+
83+
;------------------------------------------------------------------------------
84+
; 64 bit section for AMD64 and Intel EM64T based systems
85+
;------------------------------------------------------------------------------
86+
87+
[DriverInstall.NTamd64]
88+
include=mdmcpq.inf
89+
CopyFiles=DriverCopyFiles
90+
AddReg=DriverInstall.NTamd64.AddReg
91+
92+
[DriverCopyFiles]
93+
usbser.sys,,,0x20
94+
95+
[DriverInstall.NTamd64.AddReg]
96+
HKR,,DevLoader,,*ntkern
97+
HKR,,NTMPDriver,,usbser.sys
98+
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
99+
100+
[DriverInstall.NTamd64.Services]
101+
AddService=usbser, 0x00000002, DriverService
102+
103+
;------------------------------------------------------------------------------
104+
;
105+
;------------------------------------------------------------------------------
106+
107+
[DriverService]
108+
DisplayName=%SERVICE%
109+
ServiceType=1
110+
StartType=3
111+
ErrorControl=1
112+
ServiceBinary=%12%\usbser.sys
113+
114+
;------------------------------------------------------------------------------
115+
; String Definitions
116+
;------------------------------------------------------------------------------
117+
118+
[Strings]
119+
PROVIDER="Cypress"
120+
MFGNAME="Cypress Semiconductor Corporation"
121+
DESCRIPTION="Cypress USB UART"
122+
SERVICE="USB UART"

monoprog_win/run.bat

Lines changed: 0 additions & 2 deletions
This file was deleted.

package_openmono_index.json.template

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"version": "MONO_VERSION",
1515
"category": "Contributed",
1616
"help": {
17-
"online": "http://community.openmono.com/"
17+
"online": "https://community.openmono.com/category/8/arduino"
1818
},
19-
"url": "MONO_URL/mono0.8.tar.bz2",
19+
"url": "MONO_URL/MONO_NAME",
2020
"archiveFileName": "MONO_NAME",
2121
"checksum": "MD5:MONO_MD5_HASH",
2222
"size": "MONO_SIZE",
@@ -27,7 +27,29 @@
2727
],
2828
"toolsDependencies": [
2929
{ "packager": "arduino", "name": "arm-none-eabi-gcc", "version": "4.8.3-2014q1" },
30-
{"packager": "OpenMono", "name": "monoprog", "version": "0.7"}
30+
{"packager": "OpenMono", "name": "monoprog", "version": "MONOPROG_VERSION"}
31+
]
32+
},
33+
{
34+
"name": "OpenMono",
35+
"architecture": "mono",
36+
"version": "0.8",
37+
"category": "Contributed",
38+
"help": {
39+
"online": "http://community.openmono.com/"
40+
},
41+
"url": "https://github.com/getopenmono/arduino_comp/releases/download/0.8/mono0.8.tar.bz2",
42+
"archiveFileName": "mono0.8.tar.bz2",
43+
"checksum": "MD5:8d167e70c77986c83c49ea51e89a0ba6",
44+
"size": "1432962",
45+
"boards": [
46+
{"name": "Mono Basic"},
47+
{"name": "Mono Wifi"},
48+
{"name": "Mono Maker"}
49+
],
50+
"toolsDependencies": [
51+
{ "packager": "arduino", "name": "arm-none-eabi-gcc", "version": "4.8.3-2014q1" },
52+
{"packager": "OpenMono", "name": "monoprog", "version": "0.71"}
3153
]
3254
}
3355
],
@@ -52,6 +74,26 @@
5274
"size": "WIN_MONOPROG_SIZE"
5375
}
5476
]
77+
},
78+
{
79+
"name": "monoprog",
80+
"version": "0.71",
81+
"systems": [
82+
{
83+
"host": "x86_64-apple-darwin",
84+
"url": "https://github.com/getopenmono/arduino_comp/releases/download/0.8/monoprog-mac0.7.tar.bz2",
85+
"archiveFileName": "monoprog-mac0.7.tar.bz2",
86+
"checksum": "MD5:5a4d1510ee747578a01c23d9efbc87ca",
87+
"size": "2510177"
88+
},
89+
{
90+
"host": "i686-mingw32",
91+
"url": "https://github.com/getopenmono/arduino_comp/releases/download/0.8/monoprog_win0.71.tar.bz2",
92+
"archiveFileName": "monoprog_win0.71.tar.bz2",
93+
"checksum": "MD5:d115eeccb9f93d0f27d034fff383e314",
94+
"size": "2687398"
95+
}
96+
]
5597
}
5698

5799
,{

0 commit comments

Comments
 (0)