Skip to content

Commit 44ce176

Browse files
author
Jamie Smith
authored
Upconvert several targets' form factors to ARDUINO_UNO (#359)
* Upconvert several targets' form factors to arduino uno * Oops fix some unintentional changes * Add MCU description, fix pin validation errors
1 parent 626d795 commit 44ce176

File tree

9 files changed

+254
-327
lines changed

9 files changed

+254
-327
lines changed

drivers/usb/include/usb/internal/Task.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ namespace events {
2929
*/
3030

3131

32-
template<typename F, typename A1 = void, typename A2 = void, typename A3 = void, typename A4 = void, typename A5 = void>
32+
template<typename F, typename ARG1 = void, typename ARG2 = void, typename ARG3 = void, typename ARG4 = void, typename ARG5 = void>
3333
struct AllArgs;
3434

3535
template<typename B0>
@@ -543,24 +543,24 @@ class Task<R()>: public TaskBase {
543543
All _args;
544544
};
545545

546-
template <typename R, typename A0>
547-
class Task<R(A0)>: public TaskBase {
546+
template <typename R, typename ARG0>
547+
class Task<R(ARG0)>: public TaskBase {
548548
public:
549549

550-
Task(TaskQueue *q = NULL, mbed::Callback<R(A0)> cb = mbed::Callback<R(A0)>())
550+
Task(TaskQueue *q = NULL, mbed::Callback<R(ARG0)> cb = mbed::Callback<R(ARG0)>())
551551
: TaskBase(q), _args(cb)
552552
{
553553
}
554554

555-
Task &operator=(mbed::Callback<R(A0)> cb)
555+
Task &operator=(mbed::Callback<R(ARG0)> cb)
556556
{
557557
_args.b0 = cb;
558558
return *this;
559559
}
560560

561-
void call(A0 a0)
561+
void call(ARG0 arg0)
562562
{
563-
_args.b1 = a0;
563+
_args.b1 = arg0;
564564
post();
565565
}
566566

@@ -578,16 +578,16 @@ class Task<R(A0)>: public TaskBase {
578578
}
579579

580580
private:
581-
typedef AllArgs<mbed::Callback<R(A0)>, A0> All;
581+
typedef AllArgs<mbed::Callback<R(ARG0)>, ARG0> All;
582582
All _args;
583583
};
584584

585585
/** Task
586586
*
587587
* Representation of a postable task
588588
*/
589-
template <typename R, typename A0, typename A1>
590-
class Task<R(A0, A1)>: public TaskBase {
589+
template <typename R, typename ARG0, typename ARG1>
590+
class Task<R(ARG0, ARG1)>: public TaskBase {
591591
public:
592592

593593
/**
@@ -596,7 +596,7 @@ class Task<R(A0, A1)>: public TaskBase {
596596
* @param q TaskQueue to post to
597597
* @param cb Callback to run
598598
*/
599-
Task(TaskQueue *q = NULL, mbed::Callback<R(A0, A1)> cb = mbed::Callback<R(A0, A1)>())
599+
Task(TaskQueue *q = NULL, mbed::Callback<R(ARG0, ARG1)> cb = mbed::Callback<R(ARG0, ARG1)>())
600600
: TaskBase(q), _args(cb)
601601
{
602602
}
@@ -606,7 +606,7 @@ class Task<R(A0, A1)>: public TaskBase {
606606
*
607607
* @param cb Callback to run
608608
*/
609-
Task &operator=(mbed::Callback<R(A0, A1)> cb)
609+
Task &operator=(mbed::Callback<R(ARG0, ARG1)> cb)
610610
{
611611
_args.b0 = cb;
612612
return *this;
@@ -620,13 +620,13 @@ class Task<R(A0, A1)>: public TaskBase {
620620
* expects two integers as arguments to call, while Task<void()>
621621
* expects no arguments.
622622
*
623-
* @param a0 First callback parameter
624-
* @param a1 Second callback parameter
623+
* @param arg0 First callback parameter
624+
* @param arg1 Second callback parameter
625625
*/
626-
void call(A0 a0, A1 a1)
626+
void call(ARG0 arg0, ARG1 arg1)
627627
{
628-
_args.b1 = a0;
629-
_args.b2 = a1;
628+
_args.b1 = arg0;
629+
_args.b2 = arg1;
630630
post();
631631
}
632632

@@ -644,7 +644,7 @@ class Task<R(A0, A1)>: public TaskBase {
644644
}
645645

646646
private:
647-
typedef AllArgs<mbed::Callback<R(A0, A1)>, A0, A1> All;
647+
typedef AllArgs<mbed::Callback<R(ARG0, ARG1)>, ARG0, ARG1> All;
648648
All _args;
649649
};
650650

targets/TARGET_Cypress/TARGET_PSOC6/PinNames.h

Lines changed: 23 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,18 @@
8585
// LEDs
8686
#ifdef CYBSP_USER_LED1
8787
#define LED1 CYBSP_USER_LED1
88-
#else
89-
#define LED1 NC
9088
#endif
9189
#ifdef CYBSP_USER_LED2
9290
#define LED2 CYBSP_USER_LED2
93-
#else
94-
#define LED2 NC
9591
#endif
9692
#ifdef CYBSP_USER_LED3
9793
#define LED3 CYBSP_USER_LED3
98-
#else
99-
#define LED3 NC
10094
#endif
10195
#ifdef CYBSP_USER_LED4
10296
#define LED4 CYBSP_USER_LED4
103-
#else
104-
#define LED4 NC
10597
#endif
10698
#ifdef CYBSP_USER_LED5
10799
#define LED5 CYBSP_USER_LED5
108-
#else
109-
#define LED5 NC
110100
#endif
111101

112102
#ifdef CYBSP_LED_RGB_RED
@@ -152,71 +142,29 @@
152142
#endif
153143

154144
// Arduino Header
155-
#ifdef CYBSP_A0
156-
#define A0 CYBSP_A0
157-
#endif
158-
#ifdef CYBSP_A1
159-
#define A1 CYBSP_A1
160-
#endif
161-
#ifdef CYBSP_A2
162-
#define A2 CYBSP_A2
163-
#endif
164-
#ifdef CYBSP_A3
165-
#define A3 CYBSP_A3
166-
#endif
167-
#ifdef CYBSP_A4
168-
#define A4 CYBSP_A4
169-
#endif
170-
#ifdef CYBSP_A5
171-
#define A5 CYBSP_A5
172-
#endif
173-
#ifdef CYBSP_D0
174-
#define D0 CYBSP_D0
175-
#endif
176-
#ifdef CYBSP_D1
177-
#define D1 CYBSP_D1
178-
#endif
179-
#ifdef CYBSP_D2
180-
#define D2 CYBSP_D2
181-
#endif
182-
#ifdef CYBSP_D3
183-
#define D3 CYBSP_D3
184-
#endif
185-
#ifdef CYBSP_D4
186-
#define D4 CYBSP_D4
187-
#endif
188-
#ifdef CYBSP_D5
189-
#define D5 CYBSP_D5
190-
#endif
191-
#ifdef CYBSP_D6
192-
#define D6 CYBSP_D6
193-
#endif
194-
#ifdef CYBSP_D7
195-
#define D7 CYBSP_D7
196-
#endif
197-
#ifdef CYBSP_D8
198-
#define D8 CYBSP_D8
199-
#endif
200-
#ifdef CYBSP_D9
201-
#define D9 CYBSP_D9
202-
#endif
203-
#ifdef CYBSP_D10
204-
#define D10 CYBSP_D10
205-
#endif
206-
#ifdef CYBSP_D11
207-
#define D11 CYBSP_D11
208-
#endif
209-
#ifdef CYBSP_D12
210-
#define D12 CYBSP_D12
211-
#endif
212-
#ifdef CYBSP_D13
213-
#define D13 CYBSP_D13
214-
#endif
215-
#ifdef CYBSP_D14
216-
#define D14 CYBSP_D14
217-
#endif
218-
#ifdef CYBSP_D15
219-
#define D15 CYBSP_D15
145+
#ifdef TARGET_FF_ARDUINO_UNO
146+
#define ARDUINO_UNO_A0 CYBSP_A0
147+
#define ARDUINO_UNO_A1 CYBSP_A1
148+
#define ARDUINO_UNO_A2 CYBSP_A2
149+
#define ARDUINO_UNO_A3 CYBSP_A3
150+
#define ARDUINO_UNO_A4 CYBSP_A4
151+
#define ARDUINO_UNO_A5 CYBSP_A5
152+
#define ARDUINO_UNO_D0 CYBSP_D0
153+
#define ARDUINO_UNO_D1 CYBSP_D1
154+
#define ARDUINO_UNO_D2 CYBSP_D2
155+
#define ARDUINO_UNO_D3 CYBSP_D3
156+
#define ARDUINO_UNO_D4 CYBSP_D4
157+
#define ARDUINO_UNO_D5 CYBSP_D5
158+
#define ARDUINO_UNO_D6 CYBSP_D6
159+
#define ARDUINO_UNO_D7 CYBSP_D7
160+
#define ARDUINO_UNO_D8 CYBSP_D8
161+
#define ARDUINO_UNO_D9 CYBSP_D9
162+
#define ARDUINO_UNO_D10 CYBSP_D10
163+
#define ARDUINO_UNO_D11 CYBSP_D11
164+
#define ARDUINO_UNO_D12 CYBSP_D12
165+
#define ARDUINO_UNO_D13 CYBSP_D13
166+
#define ARDUINO_UNO_D14 CYBSP_D14
167+
#define ARDUINO_UNO_D15 CYBSP_D15
220168
#endif
221169

222170
#endif // MBED_PINNAMES_H

targets/TARGET_Cypress/TARGET_PSOC6/PinNamesTypes.h

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -28,74 +28,6 @@
2828
#define PullDown CYHAL_GPIO_DRIVE_PULLDOWN
2929
#define PullUp CYHAL_GPIO_DRIVE_PULLUP
3030

31-
// Arduino Headers
32-
#ifdef CYBSP_A0
33-
#define A0 CYBSP_A0
34-
#endif
35-
#ifdef CYBSP_A1
36-
#define A1 CYBSP_A1
37-
#endif
38-
#ifdef CYBSP_A2
39-
#define A2 CYBSP_A2
40-
#endif
41-
#ifdef CYBSP_A3
42-
#define A3 CYBSP_A3
43-
#endif
44-
#ifdef CYBSP_A4
45-
#define A4 CYBSP_A4
46-
#endif
47-
#ifdef CYBSP_A5
48-
#define A5 CYBSP_A5
49-
#endif
50-
#ifdef CYBSP_D0
51-
#define D0 CYBSP_D0
52-
#endif
53-
#ifdef CYBSP_D1
54-
#define D1 CYBSP_D1
55-
#endif
56-
#ifdef CYBSP_D2
57-
#define D2 CYBSP_D2
58-
#endif
59-
#ifdef CYBSP_D3
60-
#define D3 CYBSP_D3
61-
#endif
62-
#ifdef CYBSP_D4
63-
#define D4 CYBSP_D4
64-
#endif
65-
#ifdef CYBSP_D5
66-
#define D5 CYBSP_D5
67-
#endif
68-
#ifdef CYBSP_D6
69-
#define D6 CYBSP_D6
70-
#endif
71-
#ifdef CYBSP_D7
72-
#define D7 CYBSP_D7
73-
#endif
74-
#ifdef CYBSP_D8
75-
#define D8 CYBSP_D8
76-
#endif
77-
#ifdef CYBSP_D9
78-
#define D9 CYBSP_D9
79-
#endif
80-
#ifdef CYBSP_D10
81-
#define D10 CYBSP_D10
82-
#endif
83-
#ifdef CYBSP_D11
84-
#define D11 CYBSP_D11
85-
#endif
86-
#ifdef CYBSP_D12
87-
#define D12 CYBSP_D12
88-
#endif
89-
#ifdef CYBSP_D13
90-
#define D13 CYBSP_D13
91-
#endif
92-
#ifdef CYBSP_D14
93-
#define D14 CYBSP_D14
94-
#endif
95-
#ifdef CYBSP_D15
96-
#define D15 CYBSP_D15
97-
#endif
98-
9931
#ifdef __cplusplus
10032
extern "C" {
10133
#endif

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_KW41Z/TARGET_FRDM/PinNames.h

Lines changed: 36 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -64,55 +64,49 @@ typedef enum {
6464
LED_GREEN = PTA19,
6565
LED_BLUE = PTA18,
6666

67-
// mbed original LED naming
68-
LED1 = LED_RED,
69-
LED2 = LED_GREEN,
70-
LED3 = LED_BLUE,
71-
LED4 = LED_RED,
72-
73-
//Push buttons
74-
SW3 = PTC4,
75-
SW4 = PTC5,
76-
// Standardized button names
77-
BUTTON1 = SW3,
78-
BUTTON2 = SW4,
67+
// LEDs and buttons
68+
#define LED1 PTC1
69+
#define LED2 PTA19
70+
#define LED3 PTA18
71+
72+
#define BUTTON1 PTC4
73+
#define BUTTON2 PTC5
7974

8075
// USB Pins
8176
CONSOLE_TX = PTC7,
8277
CONSOLE_RX = PTC6,
8378

79+
// Not connected
80+
NC = (int)0xFFFFFFFF,
81+
82+
#ifdef TARGET_FF_ARDUINO_UNO
8483
// Arduino Headers
85-
D0 = PTC6,
86-
D1 = PTC7,
87-
D2 = PTC19,
88-
D3 = PTC16,
89-
D4 = PTC4,
90-
D5 = PTC17,
91-
D6 = PTC18,
92-
D7 = PTA1,
93-
D8 = PTA0,
94-
D9 = PTC1,
95-
D10 = PTA19,
96-
D11 = PTA16,
97-
D12 = PTA17,
98-
D13 = PTA18,
99-
D14 = PTC3,
100-
D15 = PTC2,
101-
102-
I2C_SCL = D15,
103-
I2C_SDA = D14,
104-
105-
DAC0_OUT = PTB18,
106-
107-
A0 = (int)0xFFFFFFFF,
108-
A1 = DAC0_OUT,
109-
A2 = PTB2,
110-
A3 = PTB3,
111-
A4 = PTB1,
112-
A5 = PTB0,
84+
ARDUINO_UNO_D0 = PTC6,
85+
ARDUINO_UNO_D1 = PTC7,
86+
ARDUINO_UNO_D2 = PTC19,
87+
ARDUINO_UNO_D3 = PTC16,
88+
ARDUINO_UNO_D4 = PTC4,
89+
ARDUINO_UNO_D5 = PTC17,
90+
ARDUINO_UNO_D6 = PTC18,
91+
ARDUINO_UNO_D7 = PTA1,
92+
ARDUINO_UNO_D8 = PTA0,
93+
ARDUINO_UNO_D9 = PTC1,
94+
ARDUINO_UNO_D10 = PTA19,
95+
ARDUINO_UNO_D11 = PTA16,
96+
ARDUINO_UNO_D12 = PTA17,
97+
ARDUINO_UNO_D13 = PTA18,
98+
ARDUINO_UNO_D14 = PTC3,
99+
ARDUINO_UNO_D15 = PTC2,
100+
101+
ARDUINO_UNO_A0 = NC,
102+
ARDUINO_UNO_A1 = PTB18,
103+
ARDUINO_UNO_A2 = PTB2,
104+
ARDUINO_UNO_A3 = PTB3,
105+
ARDUINO_UNO_A4 = PTB1,
106+
ARDUINO_UNO_A5 = PTB0,
107+
#endif
113108

114-
// Not connected
115-
NC = (int)0xFFFFFFFF
109+
DAC0_OUT = PTB18
116110
} PinName;
117111

118112

0 commit comments

Comments
 (0)