Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct typos of UltraStik #73

Merged
merged 1 commit into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ macros: List of individual macros. Each macro is an ordered list. The pre2015
"m1" : ["", "", "", ""]


UltiStik 360:
UltraStik 360:
version: This should be set to 1(pre 2015 board) or 2(2015 and newer). This is used for determining which version of the board to configure
Product: The UltiStik 360 product format “ultistik"
Product: The UltraStik 360 product format “ultrastik"

The following entries are available when configuring the joystick
controller id: This number is 1-4. This states which joystick this configuration is for.
map size: Always set to 9
restrictor: true or false. If you have the restrictor plate installed then this should be true
flash: true or false. If you want to flash the RAM. See the ultiStik 360 webpage for more information
flash: true or false. If you want to flash the RAM. See the UltraStik 360 webpage for more information
borders: array with the following numbers [30, 58, 86, 114, 142, 170, 198, 226]
map: An array with 81 elements for each square of the joystick. The following strings are valid entries;
“-”: empty
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Ultimarc-linux
Library and command line utility

#### Introduction:
This utility will configure the following Ultimarc boards; ServoStik, PACDrive, IPAC Ultimate, I-Pac 2, I-Pac 4, Mini-Pac, JPAC, UltraStik 360, PacLED64, U-HID and U-HID Nano. There is support for the PAC 2015 boards, Ultistik 2015 board and the previous generation of the PAC boards. It uses json configuration files to configure the different boards. It also supports the ability to change the device ID of the UltiStik 360 boards. Allowing for the configuring of four different boards at once.
This utility will configure the following Ultimarc boards; ServoStik, PACDrive, IPAC Ultimate, I-Pac 2, I-Pac 4, Mini-Pac, JPAC, UltraStik 360, PacLED64, U-HID and U-HID Nano. There is support for the PAC 2015 boards, UltraStik 2015 board and the previous generation of the PAC boards. It uses json configuration files to configure the different boards. It also supports the ability to change the device ID of the UltraStik 360 boards. Allowing for the configuring of four different boards at once.

This library and command line utility support 2012 through 2015 boards. If you need support for older Ultimarc boards, please look at the following utility developed by Travis, <a href='http://www.zumbrovalley.net/articles.php?catid=3'>Ipacutil</a> or use the Windows WinIpac v1 from <a href='http://www.ultimarc.com'>Ultimarc</a>

Expand Down
2 changes: 1 addition & 1 deletion src/libs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ AM_LDFLAGS = $(JSON_LIBS) $(LIBUSB_LIBS)


lib_LTLIBRARIES = libultimarc.la
libultimarc_la_SOURCES = ultimarc.c ipac.c ultistik.c pacLED.c common.c pacdrive.c ipacultimate.c ipacseries.c ulboard.c usbbutton.c servostik.c uhid.c ipac.h ultistik.h pacLED.h common.h pacdrive.h ipacultimate.h dbg.h ipacseries.h usbbutton.h servostik.h uhid.h
libultimarc_la_SOURCES = ultimarc.c ipac.c ultrastik.c pacLED.c common.c pacdrive.c ipacultimate.c ipacseries.c ulboard.c usbbutton.c servostik.c uhid.c ipac.h ultrastik.h pacLED.h common.h pacdrive.h ipacultimate.h dbg.h ipacseries.h usbbutton.h servostik.h uhid.h
libultimarc_la_LDFLAGS = $(AM_LDFLAGS) -version-info 1:1:0

otherincludedir = $(includedir)/ultimarc
Expand Down
2 changes: 1 addition & 1 deletion src/libs/servostik.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool validateServoStikData(json_object* jobj, ulboard* board)
return result;
}

bool updateServoStik (json_object* bcfg, ulboard* board)
bool updateBoardServoStik (json_object* bcfg, ulboard* board)
{
bool result = false;

Expand Down
2 changes: 1 addition & 1 deletion src/libs/servostik.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ typedef struct ulboard ulboard;
bool isServoStikConfig(json_object *jobj, ulboard* board);
bool validateServoStikData(json_object* jobj, ulboard* board);

bool updateServoStik(json_object* bcfg, ulboard* board);
bool updateBoardServoStik(json_object* bcfg, ulboard* board);

bool writeServoStik(unsigned char* barray, int autoconnect, bool transfer);

Expand Down
2 changes: 1 addition & 1 deletion src/libs/uhid.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ int decipherUHidLookupKey (const char* key)
return lkey;
}

bool updateUHid (json_object* bcfg, ulboard* board)
bool updateBoardUHid (json_object* bcfg, ulboard* board)
{
unsigned char* barray = NULL;

Expand Down
2 changes: 1 addition & 1 deletion src/libs/uhid.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool validateUHidMacros(json_object* jobj, bool curResult);
bool validateUHidCalibration(json_object* jobj, bool curResult);
bool validateUHidQuadratureButtonTime(json_object* jobj, bool curResult);

bool updateUHid(json_object* bcfg, ulboard* board);
bool updateBoardUHid(json_object* bcfg, ulboard* board);

void populateUHidBoardArray(enum uhid_boards_t bid, json_object* jobj, unsigned char* barray);
void populateUHidMacro(json_object* jobj, unsigned char* barray);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ulboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define ULSIZE(a) (sizeof(a)/sizeof(a[0]))
const char* ulBoardTypeName[] =
{ "null", "IPAC2", "IPAC4", "JPAC", "MINIPAC", "ULTIMATE",
"PACDRIVE", "PACLED64", "ULTISTIK", "USBBUTTON", "SERVOSTIK",
"PACDRIVE", "PACLED64", "ULTRASTIK", "USBBUTTON", "SERVOSTIK",
"UHID", "UHID NANO"};

const char* ulBoardVersionName[] =
Expand Down
2 changes: 1 addition & 1 deletion src/libs/ulboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef enum ulboard_type
ulboard_type_ultimate,
ulboard_type_pacDrive,
ulboard_type_pacLED,
ulboard_type_ultistik,
ulboard_type_ultrastik,
ulboard_type_usbbutton,
ulboard_type_servostik,
ulboard_type_uhid,
Expand Down
21 changes: 11 additions & 10 deletions src/libs/ultimarc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "ulboard.h"
#include "ipac.h"
#include "pacLED.h"
#include "ultistik.h"
#include "ultrastik.h"
#include "pacdrive.h"
#include "ipacultimate.h"
#include "usbbutton.h"
Expand All @@ -45,7 +45,7 @@ ulValidateConfig (json_object* bcfg, ulboard* ulcfg)
|| isIPACUltimateConfig (bcfg, ulcfg)
|| isPACDriveConfig (bcfg, ulcfg)
|| isPACLED64Config (bcfg, ulcfg)
|| isUltistikConfig (bcfg, ulcfg)
|| isUltraStikConfig (bcfg, ulcfg)
|| isUSBButtonConfig(bcfg, ulcfg)
|| isServoStikConfig(bcfg, ulcfg)
|| isUHidConfig (bcfg, ulcfg))
Expand Down Expand Up @@ -111,25 +111,26 @@ ulWriteToBoard (json_object* bcfg, ulboard* board)
log_info("Updating PAC LED 64 board...");
ret = updateBoardPacLED (bcfg);
}
else if (board->type == ulboard_type_ultistik)
else if (board->type == ulboard_type_ultrastik)
{
log_info("Updating Ultistik board...");
ret = updateBoardULTISTIK (bcfg, board);
log_info("Updating UltraStik board...");
ret = updateBoardUltraStik (bcfg, board);
}
else if (board->type == ulboard_type_usbbutton)
{
log_info("Updating USBButton...");
ret = updateUSBButton (bcfg, board);
log_info("Updating USBButton board...");
ret = updateBoardUSBButton (bcfg, board);
}
else if (board->type == ulboard_type_servostik)
{
log_info("Updating ServoStik...");
ret = updateServoStik (bcfg, board);
log_info("Updating ServoStik board...");
ret = updateBoardServoStik (bcfg, board);
}
else if (board->type == ulboard_type_uhid ||
board->type == ulboard_type_uhidNano)
{
ret = updateUHid (bcfg, board);
log_info("Updating UHid board...");
ret = updateBoardUHid (bcfg, board);
}

if (ret)
Expand Down
26 changes: 13 additions & 13 deletions src/libs/ultistik.c → src/libs/ultrastik.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
============================================================================
Name : ultistik.c
Name : ultrastik.c
Author : Robert Abram, Katie Snow
Version :
Copyright : Copyright 2014 Robert Abram, Katie Snow
Description : Ultimarc Ultistik configuration library
Description : Ultimarc UltraStik configuration library
============================================================================
*/

Expand All @@ -18,23 +18,23 @@

/* Local */
#include "common.h"
#include "ultistik.h"
#include "ultrastik.h"
#include "dbg.h"
#include "ulboard.h"

bool isUltistikConfig (json_object* jobj, ulboard* board)
bool isUltraStikConfig (json_object* jobj, ulboard* board)
{
bool isBoardCfg = false;

if (board->type == ulboard_type_ultistik)
if (board->type == ulboard_type_ultrastik)
{
isBoardCfg = validateUltistikData(jobj, board);
isBoardCfg = validateUltraStikData(jobj, board);
}

return isBoardCfg;
}

bool validateUltistikData(json_object* jobj, ulboard* board)
bool validateUltraStikData(json_object* jobj, ulboard* board)
{
int idx = 0;
bool valid = false;
Expand Down Expand Up @@ -62,7 +62,7 @@ bool validateUltistikData(json_object* jobj, ulboard* board)
for (idx = 0; idx < json_object_array_length(tmp); ++ idx)
{
key = json_object_array_get_idx(tmp, idx);
data = convertULTISTIK (key);
data = convertUltraStik (key);
if (strcmp(&invalidKey, &data) == -1)
{
log_err ("Error at index %i in 'map' array, entry is '%s'", idx, json_object_get_string(key));
Expand Down Expand Up @@ -195,14 +195,14 @@ bool validateUltistikData(json_object* jobj, ulboard* board)
}
else
{
log_err ("Ultistik configuration file is not configured correctly");
log_err ("UltraStik configuration file is not configured correctly");
}

return valid;
}

char
convertULTISTIK (json_object *jobj)
convertUltraStik (json_object *jobj)
{
char retval = 0xFF;
const char* str = json_object_get_string(jobj);
Expand Down Expand Up @@ -236,7 +236,7 @@ convertULTISTIK (json_object *jobj)
return retval;
}

bool updateBoardULTISTIK (json_object* jobj, ulboard* board)
bool updateBoardUltraStik (json_object* jobj, ulboard* board)
{
int idx = 0;
int itemidx = 0;
Expand Down Expand Up @@ -306,7 +306,7 @@ bool updateBoardULTISTIK (json_object* jobj, ulboard* board)
for (idx = 0; idx < json_object_array_length(innerobj); ++ idx)
{
item = json_object_array_get_idx(innerobj, idx);
data[itemidx] = convertULTISTIK(item);
data[itemidx] = convertUltraStik(item);
++itemidx;
}

Expand Down Expand Up @@ -494,7 +494,7 @@ bool updateBoardULTISTIK (json_object* jobj, ulboard* board)
break;
}

log_info ("Ultistik #%i needs to be physically disconnected and reconnected before use.", controlNew);
log_info ("UltraStik #%i needs to be physically disconnected and reconnected before use.", controlNew);
}

/* I know these have the same statement currently, but leaving
Expand Down
20 changes: 10 additions & 10 deletions src/libs/ultistik.h → src/libs/ultrastik.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
============================================================================
Name : ultistik.h
Name : ultrastik.h
Author : Robert Abram, Katie Snow
Version :
Copyright : Copyright 2014 Robert Abram, Katie Snow
Description : Ultimarc Ultistik configuration library
Description : Ultimarc UltraStik configuration library
============================================================================
*/

#ifndef ULTISTIK_H_
#define ULTISTIK_H_
#ifndef ULTRASTIK_H_
#define ULTRASTIK_H_

#include <stdbool.h>

Expand Down Expand Up @@ -38,20 +38,20 @@ extern "C" {
typedef struct json_object json_object;
typedef struct ulboard ulboard;

bool isUltistikConfig (json_object* jobj, ulboard* board);
bool isUltraStikConfig (json_object* jobj, ulboard* board);

bool validateUltistikData(json_object* jobj, ulboard* board);
bool validateUltraStikData(json_object* jobj, ulboard* board);

/*
* Convert the JSON keys data into Ultistik data
* Convert the JSON keys data into UltraStik data
* This is done one array element at a time
*/
char convertULTISTIK (json_object* jobj);
char convertUltraStik (json_object* jobj);

bool updateBoardULTISTIK (json_object* jobj, ulboard* board);
bool updateBoardUltraStik (json_object* jobj, ulboard* board);

#ifdef __cplusplus
}
#endif

#endif /* ULTISTIK_H_ */
#endif /* ULTRASTIK_H_ */
10 changes: 5 additions & 5 deletions src/libs/usbbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int usbKeyLookupTable[8][6] = {

};

bool updateUSBButton(json_object* bcfg, ulboard* board)
bool updateBoardUSBButton(json_object* bcfg, ulboard* board)
{
bool result = false;

Expand All @@ -302,18 +302,18 @@ bool updateUSBButton(json_object* bcfg, ulboard* board)
{
if (json_object_object_get_ex(bcfg, "color", &tmp))
{
result = updateUSBButtonColor(tmp, board);
result = updateBoardUSBButtonColor(tmp, board);
}
else
{
result = updateUSBButtonData(bcfg, board);
result = updateBoardUSBButtonData(bcfg, board);
}
}

return result;
}

bool updateUSBButtonColor(json_object* bcfg, ulboard* board)
bool updateBoardUSBButtonColor(json_object* bcfg, ulboard* board)
{
bool result = false;

Expand All @@ -339,7 +339,7 @@ bool updateUSBButtonColor(json_object* bcfg, ulboard* board)
return result;
}

bool updateUSBButtonData(json_object* bcfg, ulboard* board)
bool updateBoardUSBButtonData(json_object* bcfg, ulboard* board)
{
bool result = false;

Expand Down
6 changes: 3 additions & 3 deletions src/libs/usbbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ bool validateUSBButtonColor(json_object* jobj, bool curResult);
bool validateUSBButtonData(json_object* jobj, ulboard* board);
bool validateUSBButtonRowData(json_object* entries, const char* rowStr, bool curResult);

bool updateUSBButton(json_object* bcfg, ulboard* board);
bool updateUSBButtonColor(json_object* bcfg, ulboard* board);
bool updateUSBButtonData(json_object* bcfg, ulboard* board);
bool updateBoardUSBButton(json_object* bcfg, ulboard* board);
bool updateBoardUSBButtonColor(json_object* bcfg, ulboard* board);
bool updateBoardUSBButtonData(json_object* bcfg, ulboard* board);
void populateUSBKeys(json_object* keys, int row, unsigned char* barray);

bool writeUSBButton(unsigned char* barray, int autoconnect, bool transfer, unsigned int size);
Expand Down
24 changes: 12 additions & 12 deletions src/test/start.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
"../test/pacLED_invalid_current_board_id_2.json",
"../test/pacLED_invalid_new_board_id_1.json",
"../test/pacLED_invalid_new_board_id_2.json",
"../test/ultistik_invalid_controller_id.json",
"../test/ultistik_invalid_missing_controller_id.json",
"../test/ultistik_invalid_missing_5.json",
"../test/ultistik_invalid_map_size_1.json",
"../test/ultistik_invalid_map_size_2.json",
"../test/ultistik_invalid_restrictor_1.json",
"../test/ultistik_invalid_flash_1.json",
"../test/ultistik_invalid_borders_1.json",
"../test/ultistik_invalid_borders_2.json",
"../test/ultistik_invalid_map_1.json",
"../test/ultistik_invalid_map_2.json",
"../test/ultistik_invalid_map_3.json",
"../test/ultrastik_invalid_controller_id.json",
"../test/ultrastik_invalid_missing_controller_id.json",
"../test/ultrastik_invalid_missing_5.json",
"../test/ultrastik_invalid_map_size_1.json",
"../test/ultrastik_invalid_map_size_2.json",
"../test/ultrastik_invalid_restrictor_1.json",
"../test/ultrastik_invalid_flash_1.json",
"../test/ultrastik_invalid_borders_1.json",
"../test/ultrastik_invalid_borders_2.json",
"../test/ultrastik_invalid_map_1.json",
"../test/ultrastik_invalid_map_2.json",
"../test/ultrastik_invalid_map_3.json",
"../test/pacdrive_invalid_led_1.json",
"../test/pacdrive_invalid_led_2.json",
"../test/pacdrive_invalid_led_3.json",
Expand Down
2 changes: 1 addition & 1 deletion src/umtool/multiple.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"list" : [
"pacLED.json",
"ultistik_2015_map2way.json"
"ultrastik_2015_map2way.json"
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version" : 1,
"product" : "ultistik",
"product" : "ultrastik",
"current controller id" : 4,
"new controller id" : 1
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version" : 1,
"product" : "ultistik",
"product" : "ultrastik",
"controller id" : 1,
"map size" : 9,
"restrictor" : false,
Expand Down
Loading