Skip to content

Commit 1feac71

Browse files
author
ficeto
committed
Merge pull request #29 from Links2004/esp8266
pull links
2 parents 09bb758 + 690f99e commit 1feac71

File tree

10 files changed

+113
-90
lines changed

10 files changed

+113
-90
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,4 @@ nbproject
7272
build/macosx/esptool-*-osx.zip
7373

7474
build/macosx/dist/osx-xtensa-lx106-elf.tgz
75+
/hardware/esp8266com/esp8266/tools

app/src/cc/arduino/view/preferences/AdditionalBoardsManagerURLTextArea.form

+28-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
44
<Properties>
55
<Property name="defaultCloseOperation" type="int" value="2"/>
6-
<Property name="title" type="java.lang.String" value="_(&quot;Additional Boards Manager URLs: &quot;)"/>
6+
<Property name="title" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
7+
<Connection code="_(&quot;Additional Boards Manager URLs&quot;)" type="code"/>
8+
</Property>
79
<Property name="modal" type="boolean" value="true"/>
810
<Property name="modalExclusionType" type="java.awt.Dialog$ModalExclusionType" editor="org.netbeans.modules.form.editors.EnumEditor">
911
<Value id="APPLICATION_EXCLUDE"/>
@@ -32,12 +34,16 @@
3234
<EmptySpace max="-2" attributes="0"/>
3335
<Group type="103" groupAlignment="0" attributes="0">
3436
<Group type="102" attributes="0">
35-
<EmptySpace min="0" pref="439" max="32767" attributes="0"/>
37+
<EmptySpace min="0" pref="332" max="32767" attributes="0"/>
3638
<Component id="ok" min="-2" max="-2" attributes="0"/>
3739
<EmptySpace max="-2" attributes="0"/>
3840
<Component id="cancel" min="-2" max="-2" attributes="0"/>
3941
</Group>
4042
<Component id="jScrollPane1" alignment="0" max="32767" attributes="0"/>
43+
<Group type="102" alignment="0" attributes="0">
44+
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
45+
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
46+
</Group>
4147
</Group>
4248
<EmptySpace max="-2" attributes="0"/>
4349
</Group>
@@ -47,7 +53,9 @@
4753
<Group type="103" groupAlignment="0" attributes="0">
4854
<Group type="102" alignment="0" attributes="0">
4955
<EmptySpace max="-2" attributes="0"/>
50-
<Component id="jScrollPane1" pref="141" max="32767" attributes="0"/>
56+
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
57+
<EmptySpace max="-2" attributes="0"/>
58+
<Component id="jScrollPane1" pref="118" max="32767" attributes="0"/>
5159
<EmptySpace max="-2" attributes="0"/>
5260
<Group type="103" groupAlignment="3" attributes="0">
5361
<Component id="cancel" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -82,7 +90,9 @@
8290
</Container>
8391
<Component class="javax.swing.JButton" name="cancel">
8492
<Properties>
85-
<Property name="text" type="java.lang.String" value="Cancel"/>
93+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
94+
<Connection code="_(&quot;Cancel&quot;)" type="code"/>
95+
</Property>
8696
</Properties>
8797
<Events>
8898
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelActionPerformed"/>
@@ -94,7 +104,9 @@
94104
</Component>
95105
<Component class="javax.swing.JButton" name="ok">
96106
<Properties>
97-
<Property name="text" type="java.lang.String" value="OK"/>
107+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
108+
<Connection code="_(&quot;OK&quot;)" type="code"/>
109+
</Property>
98110
</Properties>
99111
<Events>
100112
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okActionPerformed"/>
@@ -104,5 +116,16 @@
104116
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
105117
</AuxValues>
106118
</Component>
119+
<Component class="javax.swing.JLabel" name="jLabel1">
120+
<Properties>
121+
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
122+
<Connection code="_(&quot;Enter additional URLs, one for each row&quot;)" type="code"/>
123+
</Property>
124+
</Properties>
125+
<AuxValues>
126+
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
127+
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
128+
</AuxValues>
129+
</Component>
107130
</SubComponents>
108131
</Form>

app/src/cc/arduino/view/preferences/AdditionalBoardsManagerURLTextArea.java

+11-45
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ private void initComponents() {
7474
javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
7575
javax.swing.JButton cancel = new javax.swing.JButton();
7676
javax.swing.JButton ok = new javax.swing.JButton();
77+
javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
7778

7879
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
7980
setTitle(_("Additional Boards Manager URLs"));
@@ -99,6 +100,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
99100
}
100101
});
101102

103+
jLabel1.setText(_("Enter additional URLs, one for each row"));
104+
102105
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
103106
getContentPane().setLayout(layout);
104107
layout.setHorizontalGroup(
@@ -107,18 +110,23 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
107110
.addContainerGap()
108111
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
109112
.addGroup(layout.createSequentialGroup()
110-
.addGap(0, 439, Short.MAX_VALUE)
113+
.addGap(0, 332, Short.MAX_VALUE)
111114
.addComponent(ok)
112115
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
113116
.addComponent(cancel))
114-
.addComponent(jScrollPane1))
117+
.addComponent(jScrollPane1)
118+
.addGroup(layout.createSequentialGroup()
119+
.addComponent(jLabel1)
120+
.addGap(0, 0, Short.MAX_VALUE)))
115121
.addContainerGap())
116122
);
117123
layout.setVerticalGroup(
118124
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
119125
.addGroup(layout.createSequentialGroup()
120126
.addContainerGap()
121-
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 141, Short.MAX_VALUE)
127+
.addComponent(jLabel1)
128+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
129+
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
122130
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
123131
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
124132
.addComponent(cancel)
@@ -139,48 +147,6 @@ private void okActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:even
139147
cancelActionPerformed(evt);
140148
}//GEN-LAST:event_okActionPerformed
141149

142-
/**
143-
* @param args the command line arguments
144-
*/
145-
public static void main(String args[]) {
146-
/* Set the Nimbus look and feel */
147-
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
148-
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
149-
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
150-
*/
151-
try {
152-
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
153-
if ("Nimbus".equals(info.getName())) {
154-
javax.swing.UIManager.setLookAndFeel(info.getClassName());
155-
break;
156-
}
157-
}
158-
} catch (ClassNotFoundException ex) {
159-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
160-
} catch (InstantiationException ex) {
161-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
162-
} catch (IllegalAccessException ex) {
163-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
164-
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
165-
java.util.logging.Logger.getLogger(AdditionalBoardsManagerURLTextArea.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
166-
}
167-
//</editor-fold>
168-
169-
/* Create and display the dialog */
170-
java.awt.EventQueue.invokeLater(new Runnable() {
171-
public void run() {
172-
AdditionalBoardsManagerURLTextArea dialog = new AdditionalBoardsManagerURLTextArea(new javax.swing.JFrame());
173-
dialog.addWindowListener(new java.awt.event.WindowAdapter() {
174-
@Override
175-
public void windowClosing(java.awt.event.WindowEvent e) {
176-
System.exit(0);
177-
}
178-
});
179-
dialog.setVisible(true);
180-
}
181-
});
182-
}
183-
184150
public void setText(String text) {
185151
Collection<String> urls = splitAndTrim(text, ",");
186152
additionalBoardsManagerURLs.setText(Joiner.on("\n").skipNulls().join(urls));

app/src/cc/arduino/view/preferences/Preferences.form

+18-15
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,16 @@
7575
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
7676
</Group>
7777
<Group type="102" alignment="1" attributes="0">
78-
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
79-
<Group type="103" groupAlignment="0" attributes="0">
80-
<Group type="102" alignment="1" attributes="0">
81-
<Component id="additionalBoardsManagerLabel" min="-2" max="-2" attributes="0"/>
82-
<EmptySpace max="-2" attributes="0"/>
83-
<Component id="additionalBoardsManagerField" min="-2" pref="494" max="-2" attributes="0"/>
84-
<EmptySpace max="-2" attributes="0"/>
85-
<Component id="extendedAdditionalUrlFieldWindow" min="-2" pref="36" max="-2" attributes="0"/>
86-
</Group>
87-
<Group type="102" alignment="1" attributes="0">
88-
<Component id="okButton" min="-2" max="-2" attributes="0"/>
89-
<EmptySpace max="-2" attributes="0"/>
90-
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
91-
</Group>
92-
</Group>
78+
<Component id="okButton" min="-2" max="-2" attributes="0"/>
79+
<EmptySpace max="-2" attributes="0"/>
80+
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
81+
</Group>
82+
<Group type="102" alignment="1" attributes="0">
83+
<Component id="additionalBoardsManagerLabel" min="-2" max="-2" attributes="0"/>
84+
<EmptySpace max="-2" attributes="0"/>
85+
<Component id="additionalBoardsManagerField" min="-2" pref="500" max="-2" attributes="0"/>
86+
<EmptySpace max="-2" attributes="0"/>
87+
<Component id="extendedAdditionalUrlFieldWindow" min="-2" pref="36" max="-2" attributes="0"/>
9388
</Group>
9489
</Group>
9590
<EmptySpace max="-2" attributes="0"/>
@@ -472,13 +467,21 @@
472467
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
473468
<Connection code="_(&quot;Additional Boards Manager URLs: &quot;)" type="code"/>
474469
</Property>
470+
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
471+
<Connection code="_(&quot;Enter a comma separated list of urls&quot;)" type="code"/>
472+
</Property>
475473
</Properties>
476474
<AuxValues>
477475
<AuxValue name="JavaCodeGenerator_VariableLocal" type="java.lang.Boolean" value="true"/>
478476
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
479477
</AuxValues>
480478
</Component>
481479
<Component class="javax.swing.JTextField" name="additionalBoardsManagerField">
480+
<Properties>
481+
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
482+
<Connection code="_(&quot;Enter a comma separated list of urls&quot;)" type="code"/>
483+
</Property>
484+
</Properties>
482485
</Component>
483486
<Component class="javax.swing.JButton" name="extendedAdditionalUrlFieldWindow">
484487
<Properties>

app/src/cc/arduino/view/preferences/Preferences.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
379379
);
380380

381381
additionalBoardsManagerLabel.setText(_("Additional Boards Manager URLs: "));
382+
additionalBoardsManagerLabel.setToolTipText(_("Enter a comma separated list of urls"));
383+
384+
additionalBoardsManagerField.setToolTipText(_("Enter a comma separated list of urls"));
382385

383386
extendedAdditionalUrlFieldWindow.setIcon(new ImageIcon(Base.getThemeImage("newwindow.gif", this)));
384387
extendedAdditionalUrlFieldWindow.addActionListener(new java.awt.event.ActionListener() {
@@ -490,18 +493,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
490493
.addComponent(preferencesFileLabel))
491494
.addGap(0, 0, Short.MAX_VALUE))
492495
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
493-
.addGap(0, 0, Short.MAX_VALUE)
494-
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
495-
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
496-
.addComponent(additionalBoardsManagerLabel)
497-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
498-
.addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 494, javax.swing.GroupLayout.PREFERRED_SIZE)
499-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
500-
.addComponent(extendedAdditionalUrlFieldWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
501-
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
502-
.addComponent(okButton)
503-
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
504-
.addComponent(cancelButton)))))
496+
.addComponent(okButton)
497+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
498+
.addComponent(cancelButton))
499+
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
500+
.addComponent(additionalBoardsManagerLabel)
501+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
502+
.addComponent(additionalBoardsManagerField, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
503+
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
504+
.addComponent(extendedAdditionalUrlFieldWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
505505
.addContainerGap())
506506
);
507507
layout.setVerticalGroup(

app/src/processing/app/Editor.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ public void actionPerformed(ActionEvent e) {
14221422
if (find == null) {
14231423
find = new FindReplace(Editor.this);
14241424
}
1425-
if (!OSUtils.isMacOS() && getSelectedText() != null) {
1425+
if (!OSUtils.isMacOS()) {
14261426
find.setFindText(getSelectedText());
14271427
}
14281428
find.setLocationRelativeTo(Editor.this);
@@ -1458,11 +1458,8 @@ public void actionPerformed(ActionEvent e) {
14581458
if (find == null) {
14591459
find = new FindReplace(Editor.this);
14601460
}
1461-
if (getSelectedText() != null) {
1462-
find.setFindText(getSelectedText());
1463-
}
1464-
find.setLocationRelativeTo(Editor.this);
1465-
find.setVisible(true);
1461+
find.setFindText(getSelectedText());
1462+
find.findNext();
14661463
}
14671464
});
14681465
menu.add(item);

app/src/processing/app/FindReplace.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,12 @@ public void replaceAll() {
439439
}
440440
}
441441

442-
public void setFindText(String t) {
443-
findField.setText(t);
444-
findString = t;
442+
public void setFindText(String text) {
443+
if (text == null) {
444+
return;
445+
}
446+
findField.setText(text);
447+
findString = text;
445448
}
446449

447450
public void findNext() {

hardware/esp8266com/esp8266/cores/esp8266/debug.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void ICACHE_RAM_ATTR hexdump(uint8_t *mem, uint32_t len, uint8_t cols) {
2626
for(uint32_t i = 0; i < len; i++) {
2727
if(i % cols == 0) {
2828
os_printf("\n[0x%08X] 0x%08X: ", mem, i);
29+
yield();
2930
}
3031
os_printf("%02X ", *mem);
3132
mem++;

libraries/Adafruit_ILI9341/Adafruit_ILI9341.cpp

+25-3
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void Adafruit_ILI9341::spiwrite(uint8_t c) {
127127
#endif
128128
}
129129

130-
void Adafruit_ILI9341::spiwriteBytes(uint8_t * data, uint8_t size) {
130+
void Adafruit_ILI9341::spiwriteBytes(uint8_t * data, uint32_t size) {
131131
#ifdef ESP8266
132132
SPI.writeBytes(data, size);
133133
#else
@@ -250,13 +250,21 @@ void Adafruit_ILI9341::writeCmdData(uint8_t cmd, uint8_t * data, uint8_t size) {
250250
spiCsHigh();
251251
}
252252

253+
uint16_t Adafruit_ILI9341::getHeight(void) {
254+
return _height;
255+
}
256+
257+
uint16_t Adafruit_ILI9341::getWidth(void){
258+
return _width;
259+
}
260+
253261
// If the SPI library has transaction support, these functions
254262
// establish settings and protect from interference from other
255263
// libraries. Otherwise, they simply do nothing.
256264
#ifdef SPI_HAS_TRANSACTION
257265

258266
#ifdef ESP8266
259-
SPISettings spiSettings = SPISettings(F_CPU, MSBFIRST, SPI_MODE0);
267+
SPISettings spiSettings = SPISettings(SPI_MAX_SPEED, MSBFIRST, SPI_MODE0);
260268
#else
261269
SPISettings spiSettings = SPISettings(8000000, MSBFIRST, SPI_MODE0);
262270
#endif
@@ -438,6 +446,20 @@ void Adafruit_ILI9341::begin(void) {
438446

439447
}
440448

449+
450+
void Adafruit_ILI9341::area_update_start(uint32_t x, uint32_t y, uint32_t w, uint32_t h) {
451+
spiCsLow();
452+
setAddrWindow_(x, y, x + w - 1, y + h - 1);
453+
}
454+
455+
void Adafruit_ILI9341::area_update_data(uint8_t *data, uint32_t pixel){
456+
spiwriteBytes(&data[0], (pixel*2));
457+
}
458+
459+
void Adafruit_ILI9341::area_update_end(void){
460+
spiCsHigh();
461+
}
462+
441463
void Adafruit_ILI9341::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
442464
spiCsLow();
443465
setAddrWindow_(x0, y0, x1, y1);
@@ -583,7 +605,7 @@ void Adafruit_ILI9341::fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint
583605

584606
spiCsLow();
585607

586-
setAddrWindow_(x, y, x + w - 1, y + h - 1);
608+
setAddrWindow_(x, y, (x + w - 1), (y + h - 1));
587609

588610
uint8_t colorBin[] = { (uint8_t) (color >> 8), (uint8_t) color };
589611
spiwritePattern(&colorBin[0], 2, (w * h));

0 commit comments

Comments
 (0)