Skip to content

Commit

Permalink
xpd: Cleaned up whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
xross committed Jul 29, 2022
1 parent 6ec4b67 commit 99ee04e
Show file tree
Hide file tree
Showing 90 changed files with 783 additions and 783 deletions.
2 changes: 1 addition & 1 deletion __app_test_mode/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
XUD_EpType epTypeTableOut[EP_COUNT_OUT] = {XUD_EPTYPE_CTL};
XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL};


int main()
{
chan c_ep_out[EP_COUNT_OUT], c_ep_in[EP_COUNT_IN];
Expand Down
8 changes: 4 additions & 4 deletions examples/AN00124_CDC_VCOM_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ XUD_EpType epTypeTableOut[XUD_EP_COUNT_OUT] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABL
XUD_EpType epTypeTableIn[XUD_EP_COUNT_IN] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, XUD_EPTYPE_INT, XUD_EPTYPE_BUL};

/* Application task */
void app_virtual_com(client interface usb_cdc_interface cdc)
void app_virtual_com(client interface usb_cdc_interface cdc)
{
while (1)
while (1)
{
char cdc_char = cdc.get_char();
cdc.put_char(cdc_char);
Expand All @@ -28,7 +28,7 @@ void app_virtual_com(client interface usb_cdc_interface cdc)
}
}

int main()
int main()
{
/* Channels to communicate with USB endpoints */
chan c_ep_out[XUD_EP_COUNT_OUT], c_ep_in[XUD_EP_COUNT_IN];
Expand All @@ -39,7 +39,7 @@ int main()
par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
2 changes: 1 addition & 1 deletion examples/AN00125_mass_storage_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main()
par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
442 changes: 221 additions & 221 deletions examples/AN00125_mass_storage_class/src/mass_storage.xc

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/AN00126_printer_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void print_string(unsigned char *string, unsigned size)
void printer_main(chanend c_ep_prt_out)
{
unsigned size;
unsigned char print_packet[1024]; // Buffer for storing printer packets sent from host
unsigned char print_packet[1024]; // Buffer for storing printer packets sent from host

debug_printf("USB printer class demo started\n");

Expand All @@ -68,7 +68,7 @@ void printer_main(chanend c_ep_prt_out)
while (1)
{
// Perform a blocking read waiting for data to be received at the endpoint
XUD_GetBuffer(ep_out, print_packet, size);
XUD_GetBuffer(ep_out, print_packet, size);
debug_printf("**** Received %d byte print buffer ****\n", size);
print_string(print_packet, size);
}
Expand All @@ -83,7 +83,7 @@ int main()
par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
2 changes: 1 addition & 1 deletion examples/AN00127_video_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main() {
par
{
on USB_TILE: XUD_Main(c_ep_out, EP_COUNT_OUT, c_ep_in, EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
6 changes: 3 additions & 3 deletions examples/AN00129_hid_class/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,15 +194,15 @@ void Endpoint0(chanend_t chan_ep0_out, chanend_t chan_ep0_in)

DECLARE_JOB(hid_mouse, (chanend_t));
/*
* This function responds to the HID requests
* This function responds to the HID requests
* - It draws a square using the mouse moving 40 pixels in each direction
* - The sequence repeats every 500 requests.
*/
void hid_mouse(chanend_t chan_ep_hid)
{
unsigned int counter = 0;
enum {RIGHT, DOWN, LEFT, UP} state = RIGHT;

printf("hid_mouse: %x\n", chan_ep_hid);
XUD_ep ep_hid = XUD_InitEp(chan_ep_hid);

Expand Down Expand Up @@ -295,4 +295,4 @@ int main()
);

return 0;
}
}
8 changes: 4 additions & 4 deletions examples/AN00129_hid_class/src/main.xc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2015-2021 XMOS LIMITED.
// This Software is subject to the terms of the XMOS Public Licence: Version 1.
#include "xud_device.h"
#include "hid_defs.h"
#include "hid_defs.h"

/* Number of Endpoints used by this app */
#define EP_COUNT_OUT 1
Expand All @@ -17,15 +17,15 @@ XUD_EpType epTypeTableIn[EP_COUNT_IN] = {XUD_EPTYPE_CTL | XUD_STATUS_ENABLE, X
void Endpoint0(chanend c_ep0_out, chanend c_ep0_in);

/*
* This function responds to the HID requests
* This function responds to the HID requests
* - It draws a square using the mouse moving 40 pixels in each direction
* - The sequence repeats every 500 requests.
*/
void hid_mouse(chanend chan_ep_hid)
{
unsigned int counter = 0;
enum {RIGHT, DOWN, LEFT, UP} state = RIGHT;

XUD_ep ep_hid = XUD_InitEp(chan_ep_hid);

for(;;)
Expand Down Expand Up @@ -67,7 +67,7 @@ void hid_mouse(chanend chan_ep_hid)
unsafe {
/* global buffer 'g_reportBuffer' defined in hid_defs.h */
char * unsafe p_reportBuffer = g_reportBuffer;

p_reportBuffer[1] = x;
p_reportBuffer[2] = y;

Expand Down
2 changes: 1 addition & 1 deletion examples/AN00131_CDC_EDC_class/src/eth_tcp/femtoTCP.xc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void tcpString(char s[], unsigned int rsp_packet[], unsigned &rsp_len) {
(rsp_packet, unsigned char[])[HEADERS_LEN_TCP+len] = 0;

patchTCPHeader(rsp_packet, len, ACK | PSH | FIN);

rsp_len = HEADERS_LEN_TCP + len;
stream[stream_index].sequenceNumber += len;
return;
Expand Down
2 changes: 1 addition & 1 deletion examples/AN00131_CDC_EDC_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main() {
par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
2 changes: 1 addition & 1 deletion examples/AN00132_image_class/host/ptp.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ typedef struct _PTPObjectInfo PTPObjectInfo;
#define PTP_DPC_NIKON_E3AAFlashMode 0xD076
#define PTP_DPC_NIKON_E4ModelingFlash 0xD077
#define PTP_DPC_NIKON_BracketSet 0xD078
#define PTP_DPC_NIKON_E6ManualModeBracketing 0xD079
#define PTP_DPC_NIKON_E6ManualModeBracketing 0xD079
#define PTP_DPC_NIKON_BracketOrder 0xD07A
#define PTP_DPC_NIKON_E8AutoBracketSelection 0xD07B
#define PTP_DPC_NIKON_BracketingSet 0xD07C
Expand Down
2 changes: 1 addition & 1 deletion examples/AN00132_image_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int main()
par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
8 changes: 4 additions & 4 deletions examples/AN00135_test_and_measurement_class/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void _usbtmc_bulk_endpoints(chanend_t c_ep_out, chanend_t c_ep_in)
XUD_SetReady_Out (ep_out, host_transfer_buf);

SCPI_initialize_parser();

SELECT_RES(
CASE_THEN(c_ep_out, xud_getdata_select_handler),
CASE_THEN(c_ep_in, xud_setdata_select_handler))
Expand Down Expand Up @@ -91,11 +91,11 @@ void _usbtmc_bulk_endpoints(chanend_t c_ep_out, chanend_t c_ep_in)
case REQUEST_VENDOR_SPECIFIC_IN:
/* Handle any vendor specific command messages */
break;

default:
break;
}

/* Mark EP as ready again */
XUD_SetReady_Out (ep_out, host_transfer_buf);
continue;
Expand All @@ -110,7 +110,7 @@ void _usbtmc_bulk_endpoints(chanend_t c_ep_out, chanend_t c_ep_in)
XUD_SetReady_Out (ep_out, host_transfer_buf);
continue;
}

}


Expand Down
2 changes: 1 addition & 1 deletion examples/AN00135_test_and_measurement_class/src/main.xc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main()
par
{
on USB_TILE: XUD_Main(c_ep_out, XUD_EP_COUNT_OUT, c_ep_in, XUD_EP_COUNT_IN,
null, epTypeTableOut, epTypeTableIn,
null, epTypeTableOut, epTypeTableIn,
XUD_SPEED_HS, XUD_PWR_BUS);

on USB_TILE: Endpoint0(c_ep_out[0], c_ep_in[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2012-2013 Jan Breuer,
*
* All Rights Reserved
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
Expand All @@ -11,7 +11,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand All @@ -28,10 +28,10 @@
/**
* @file scpi_debug.c
* @date Thu Nov 15 10:58:45 UTC 2012
*
*
* @brief Debugging SCPI
*
*
*
*
*/

#include <stdio.h>
Expand All @@ -40,14 +40,14 @@
/**
* Debug function: show current command and its parameters
* @param context
* @return
* @return
*/
scpi_bool_t SCPI_DebugCommand(scpi_t * context) {
size_t res;
printf("**DEBUG: %s (\"", context->paramlist.cmd->pattern);
res = fwrite(context->paramlist.parameters, 1, context->paramlist.length, stdout);
(void)res;
printf("\" - %lu\r\n", (unsigned long)context->paramlist.length);

return TRUE;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2012-2013 Jan Breuer,
*
* All Rights Reserved
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
Expand All @@ -11,7 +11,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Expand All @@ -28,10 +28,10 @@
/**
* @file scpi_error.c
* @date Thu Nov 15 10:58:45 UTC 2012
*
*
* @brief Error handling and storing routines
*
*
*
*
*/

#include <stdint.h>
Expand Down Expand Up @@ -95,7 +95,7 @@ int16_t SCPI_ErrorPop(scpi_t * context) {
/**
* Return number of errors/events in the queue
* @param context
* @return
* @return
*/
int32_t SCPI_ErrorCount(scpi_t * context) {
int16_t result = 0;
Expand Down Expand Up @@ -176,7 +176,7 @@ const char * SCPI_ErrorTranslate(int16_t err) {
case 0: return "No error";
#define X(def, val, str) case def: return str;
LIST_OF_ERRORS
#undef X
#undef X
default: return "Unknown error";
}
}
Expand Down
Loading

0 comments on commit 99ee04e

Please sign in to comment.