Skip to content

Commit cfb7638

Browse files
committed
clangformat - examples
As to try to get it in a state that a Pull is accepted
1 parent ddecd0c commit cfb7638

File tree

2 files changed

+44
-27
lines changed

2 files changed

+44
-27
lines changed

examples/Touch_IRQ/Touch_IRQ.ino

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
1-
/*
1+
/*
22
* Touch_IRQ.ino
3-
*
4-
* This example shows how to get the number of points and the coordinates of the first touch points detected by the touch controller using interrupts.
5-
*
6-
* The setup() function initializes the serial communication and the touch controller. Whenever a touch event is detcted, the gigaTouchHandler function is called that prints the number of points and first touch co-ordinates to the Serial Monitor. The loop() function is empty because the touch controller is configured to work with interrupts.
7-
*
3+
*
4+
* This example shows how to get the number of points and the coordinates of the
5+
* first touch points detected by the touch controller using interrupts.
6+
*
7+
* The setup() function initializes the serial communication and the touch
8+
* controller. Whenever a touch event is detcted, the gigaTouchHandler function
9+
* is called that prints the number of points and first touch co-ordinates to
10+
* the Serial Monitor. The loop() function is empty because the touch controller
11+
* is configured to work with interrupts.
12+
*
813
* For the polling version of this example, see Touch_Polling.ino
9-
*
14+
*
1015
* Instructions:
11-
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063) board .
16+
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063)
17+
* board .
1218
* 2. Upload this sketch to your board.
1319
* 3. Open the Serial Monitor.
14-
* 4. Touch the screen with your finger(s) and view the coordinates printed on the Serial Monitor.
15-
*
20+
* 4. Touch the screen with your finger(s) and view the coordinates printed on
21+
* the Serial Monitor.
22+
*
1623
* Initial author: Leonardo Cavagnis @leonardocavagnis
1724
* Created: 03 May 2023
1825
*/
@@ -21,7 +28,7 @@
2128

2229
Arduino_GigaDisplayTouch touchDetector;
2330

24-
void gigaTouchHandler(uint8_t contacts, GDTpoint_t* points) {
31+
void gigaTouchHandler(uint8_t contacts, GDTpoint_t *points) {
2532
Serial.print("Contacts: ");
2633
Serial.println(contacts);
2734

@@ -35,16 +42,18 @@ void gigaTouchHandler(uint8_t contacts, GDTpoint_t* points) {
3542

3643
void setup() {
3744
Serial.begin(115200);
38-
while(!Serial) {}
45+
while (!Serial) {
46+
}
3947

4048
if (touchDetector.begin()) {
4149
Serial.println("Touch controller init - OK");
4250
} else {
4351
Serial.println("Touch controller init - FAILED");
44-
while(1) ;
52+
while (1)
53+
;
4554
}
4655

4756
touchDetector.onDetect(gigaTouchHandler);
4857
}
4958

50-
void loop() { }
59+
void loop() {}

examples/Touch_Polling/Touch_Polling.ino

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
/*
1+
/*
22
* Touch_Polling.ino
3-
*
4-
* This example shows how to get the number of points and the coordinates of the first touch points detected by the touch controller using polling.
5-
*
6-
* The setup() function initializes the serial communication and the touch controller. The loop() function continuously checks to see if a touch event is detected. Whenever a touch event is detcted, that prints the number of points and first touch co-ordinates to the Serial Monitor.
7-
*
3+
*
4+
* This example shows how to get the number of points and the coordinates of the
5+
* first touch points detected by the touch controller using polling.
6+
*
7+
* The setup() function initializes the serial communication and the touch
8+
* controller. The loop() function continuously checks to see if a touch event
9+
* is detected. Whenever a touch event is detcted, that prints the number of
10+
* points and first touch co-ordinates to the Serial Monitor.
11+
*
812
* For the interrupt version of this example, see Touch_IRQ.ino
9-
*
13+
*
1014
* Instructions:
11-
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063) board .
15+
* 1. Connect your GIGA Display Shield (ASX00039) to a GIGA R1 WiFi (ABX00063)
16+
* board .
1217
* 2. Upload this sketch to your board.
1318
* 3. Open the Serial Monitor.
14-
* 4. Touch the screen with your finger(s) and view the coordinates printed on the Serial Monitor.
15-
*
19+
* 4. Touch the screen with your finger(s) and view the coordinates printed on
20+
* the Serial Monitor.
21+
*
1622
* Initial author: Leonardo Cavagnis @leonardocavagnis
1723
* Created: 03 May 2023
1824
*/
@@ -23,20 +29,22 @@ Arduino_GigaDisplayTouch touchDetector;
2329

2430
void setup() {
2531
Serial.begin(115200);
26-
while(!Serial) {}
32+
while (!Serial) {
33+
}
2734

2835
if (touchDetector.begin()) {
2936
Serial.print("Touch controller init - OK");
3037
} else {
3138
Serial.print("Touch controller init - FAILED");
32-
while(1) ;
39+
while (1)
40+
;
3341
}
3442
}
3543

3644
void loop() {
3745
uint8_t contacts;
3846
GDTpoint_t points[5];
39-
47+
4048
contacts = touchDetector.getTouchPoints(points);
4149

4250
if (contacts > 0) {

0 commit comments

Comments
 (0)