  		quit(1, "Failed to create bxf read_thr");
 +
  	return bxf_send_clock(bitfury, info, opt_bxf_bits);
->>>>>>> Stashed changes
- }
-@@ -2683,9 +2516,9 @@ static void minion_shutdown(struct thr_info *thr)
- static bool minion_queue_full(struct cgpu_info *minioncgpu)
- {
- 	struct minion_info *minioninfo = (struct minion_info *)(minioncgpu->device_data);
--	struct work *work, *usework;
--	int count, need, roll, roll_limit;
--	bool ret, rolled;
-+	struct work *work;
-+	int count;
-+	bool ret;
- 
-<<<<<<< Updated upstream
- 	K_RLOCK(minioninfo->wwork_list);
- 	count = minioninfo->wwork_list->count;
-@@ -2694,32 +2527,14 @@ static bool minion_queue_full(struct cgpu_info *minioncgpu)
- 	if (count >= (MINION_QUE_HIGH * minioninfo->chips))
- 		ret = true;
- 	else {
--		need = (MINION_QUE_HIGH * minioninfo->chips) - count;
- 		work = get_queued(minioncgpu);
--		if (work) {
--			roll_limit = work->drv_rolllimit;
--			roll = 0;
--			do {
--				if (roll == 0) {
--					usework = work;
--					minioninfo->work_unrolled++;
--					rolled = false;
--				} else {
--					usework = copy_work_noffset(work, roll);
--					minioninfo->work_rolled++;
--					rolled = true;
--				}
--				ready_work(minioncgpu, usework, rolled);
--			} while (--need > 0 && ++roll <= roll_limit);
--		} else {
-+		if (work)
-+			ready_work(minioncgpu, work);
-+		else
- 			// Avoid a hard loop when we can't get work fast enough
- 			cgsleep_us(42);
--		}
- 
--		if (need > 0)
--			ret = false;
--		else
--			ret = true;
-+		ret = false;
- 	}
- 
- 	return ret;
-@@ -2750,23 +2565,6 @@ static int64_t minion_scanwork(__maybe_unused struct thr_info *thr)
- 	return hashcount;
- }
- 
--static const char *temp_str(uint16_t temp)
--{
--	switch (temp) {
--		case MINION_TEMP_40:
--			return min_temp_40;
--		case MINION_TEMP_60:
--			return min_temp_60;
--		case MINION_TEMP_80:
--			return min_temp_80;
--		case MINION_TEMP_100:
--			return min_temp_100;
--		case MINION_TEMP_OVER:
--			return min_temp_over;
--	}
--	return min_temp_invalid;
--}
--
- static void minion_get_statline_before(char *buf, size_t bufsiz, struct cgpu_info *minioncgpu)
- {
- 	struct minion_info *minioninfo = (struct minion_info *)(minioncgpu->device_data);
-@@ -2785,8 +2583,8 @@ static void minion_get_statline_before(char *buf, size_t bufsiz, struct cgpu_inf
- 	}
- 	mutex_unlock(&(minioninfo->sta_lock));
- 
--	tailsprintf(buf, bufsiz, "max%sC Ch:%2d Co:%d",
--				 temp_str(max_temp), minioninfo->chips, (int)cores);
-+	tailsprintf(buf, bufsiz, "max%3dC Ch:%2d Co:%d",
-+				 (int)max_temp, minioninfo->chips, (int)cores);
- }
- 
- #define CHIPS_PER_STAT 8
-@@ -2812,21 +2610,9 @@ static struct api_data *minion_api_stats(struct cgpu_info *minioncgpu)
- 
- 	max_chip = 0;
- 	for (chip = 0; chip < MINION_CHIPS; chip++)
--		if (minioninfo->chip[chip]) {
-+		if (minioninfo->chip[chip])
- 			max_chip = chip;
- 
--			snprintf(buf, sizeof(buf), "Chip %d Temperature", chip);
--			root = api_add_const(root, buf, temp_str(minioninfo->chip_status[chip].temp), false);
--			snprintf(buf, sizeof(buf), "Chip %d Cores", chip);
--			root = api_add_uint16(root, buf, &(minioninfo->chip_status[chip].cores), true);
--			snprintf(buf, sizeof(buf), "Chip %d Frequency", chip);
--			root = api_add_uint32(root, buf, &(minioninfo->chip_status[chip].freq), true);
--			snprintf(buf, sizeof(buf), "Chip %d InitFreq", chip);
--			root = api_add_int(root, buf, &(minioninfo->init_freq[chip]), true);
--			snprintf(buf, sizeof(buf), "Chip %d Overheat", chip);
--			root = api_add_bool(root, buf, &(minioninfo->chip_status[chip].overheat), true);
--		}
--
- 	for (i = 0; i <= max_chip; i += CHIPS_PER_STAT) {
- 		to = i + CHIPS_PER_STAT - 1;
- 		if (to > max_chip)
-@@ -2896,7 +2682,6 @@ static struct api_data *minion_api_stats(struct cgpu_info *minioncgpu)
- 	root = api_add_int(root, "RFree Count", &(minioninfo->rfree_list->count), true);
- 	root = api_add_int(root, "RNonce Count", &(minioninfo->rnonce_list->count), true);
- 
--#if DO_IO_STATS
- #define sta_api(_name, _iostat) \
- 	do { \
- 		if ((_iostat).count) { \
-@@ -2940,10 +2725,6 @@ static struct api_data *minion_api_stats(struct cgpu_info *minioncgpu)
- 				    minioncgpu->drv->name, minioncgpu->device_id,
- 				    total_secs, buf, data);
- 	}
--#endif
--
--	root = api_add_uint64(root, "Work Unrolled", &(minioninfo->work_unrolled), true);
--	root = api_add_uint64(root, "Work Rolled", &(minioninfo->work_rolled), true);
- 
- 	root = api_add_elapsed(root, "Elapsed", &(total_secs), true);
- 
-diff --git a/driver-spondoolies.c b/driver-spondoolies.c
-index 6aa66cf..d3e802f 100644
---- a/driver-spondoolies.c
-+++ b/driver-spondoolies.c
-@@ -184,7 +184,7 @@ static struct api_data *spondoolies_api_stats(struct cgpu_info *cgpu)
- 	struct spond_adapter *a = cgpu->device_data;
- 	struct api_data *root = NULL;
- 
--	root = api_add_int(root, "ASICs total rate", &a->temp_rate, false);
-+	root = api_add_int(root, "Temperature rate", &a->temp_rate, false);
- 	root = api_add_int(root, "Temparature rear", &a->rear_temp, false);
- 	root = api_add_int(root, "Temparature front", &a->front_temp, false);
- 
-@@ -223,7 +223,7 @@ static void fill_minergate_request(minergate_do_job_req* work, struct work *cg_w
- 				   int ntime_offset)
- {
- 	uint32_t x[64/4];
--	uint64_t wd;
-+	int wd;
- 
- 	memset(work, 0, sizeof(minergate_do_job_req));
- 	//work->
-@@ -237,7 +237,7 @@ static void fill_minergate_request(minergate_do_job_req* work, struct work *cg_w
- 	//work->leading_zeroes = get_leading_zeroes(cg_work->target);
- 	// Is there no better way to get leading zeroes?
- 	work->leading_zeroes = 30;
--	wd = round(cg_work->work_difficulty);
-+	wd = (int)round(cg_work->work_difficulty);
- 	while (wd) {
- 		work->leading_zeroes++;
- 		wd = wd >> 1;
-@@ -430,7 +430,6 @@ struct device_drv spondoolies_drv = {
- 	.drv_id = DRIVER_spondoolies,
- 	.dname = "Spondoolies",
- 	.name = "SPN",
--	.max_diff = 32.0, // Limit max diff to get some nonces back regardless
- 	.drv_detect = spondoolies_detect,
- 	.get_api_stats = spondoolies_api_stats,
- 	.thread_prepare = spondoolies_prepare,
-diff --git a/libbitfury.c b/libbitfury.c
-index 78f982c..1857464 100644
---- a/libbitfury.c
-+++ b/libbitfury.c
-@@ -122,7 +122,7 @@ void spi_set_freq(struct bitfury_info *info)
- 
- void spi_send_conf(struct bitfury_info *info)
- {
--	const int8_t nfu_counters[16] = { 64, 64, SECOND_BASE, SECOND_BASE+4, SECOND_BASE+2,
-+	const int8_t nf1_counters[16] = { 64, 64, SECOND_BASE, SECOND_BASE+4, SECOND_BASE+2,
- 		SECOND_BASE+2+16, SECOND_BASE, SECOND_BASE+1, (FIRST_BASE)%65, (FIRST_BASE+1)%65,
- 		(FIRST_BASE+3)%65, (FIRST_BASE+3+16)%65, (FIRST_BASE+4)%65, (FIRST_BASE+4+4)%65,
- 		(FIRST_BASE+3+3)%65, (FIRST_BASE+3+1+3)%65 };
-@@ -136,7 +136,7 @@ void spi_send_conf(struct bitfury_info *info)
- 		spi_config_reg(info, i, 0);
- 	/* Program counters correctly for rounds processing, here it should
- 	 * start consuming power */
--	spi_add_data(info, 0x0100, nfu_counters, 16);
-+	spi_add_data(info, 0x0100, nf1_counters, 16);
- }
- 
- void spi_send_init(struct bitfury_info *info)
-@@ -228,9 +228,9 @@ bool spi_reset(struct cgpu_info *bitfury, struct bitfury_info *info)
- 	int r;
- 
- 	// SCK_OVRRIDE
--	mcp->value.pin[NFU_PIN_SCK_OVR] = MCP2210_GPIO_PIN_HIGH;
--	mcp->direction.pin[NFU_PIN_SCK_OVR] = MCP2210_GPIO_OUTPUT;
--	mcp->designation.pin[NFU_PIN_SCK_OVR] = MCP2210_PIN_GPIO;
-+	mcp->value.pin[NF1_PIN_SCK_OVR] = MCP2210_GPIO_PIN_HIGH;
-+	mcp->direction.pin[NF1_PIN_SCK_OVR] = MCP2210_GPIO_OUTPUT;
-+	mcp->designation.pin[NF1_PIN_SCK_OVR] = MCP2210_PIN_GPIO;
- 	if (!mcp2210_set_gpio_settings(bitfury, mcp))
- 		return false;
- 
-@@ -243,7 +243,7 @@ bool spi_reset(struct cgpu_info *bitfury, struct bitfury_info *info)
- 	}
- 
- 	// Deactivate override
--	mcp->direction.pin[NFU_PIN_SCK_OVR] = MCP2210_GPIO_INPUT;
-+	mcp->direction.pin[NF1_PIN_SCK_OVR] = MCP2210_GPIO_INPUT;
- 	if (!mcp2210_set_gpio_settings(bitfury, mcp))
- 		return false;
- 
-@@ -370,10 +370,8 @@ bool libbitfury_sendHashData(struct thr_info *thr, struct cgpu_info *bitfury,
- 					uint32_t nonce; //possible nonce
- 
- 					nonce = decnonce(newbuf[i]);
--					if (bitfury_checkresults(thr, info->owork[chip_n], nonce)) {
--						info->submits[chip_n]++;
-+					if (bitfury_checkresults(thr, info->owork[chip_n], nonce))
- 						info->nonces++;
--					}
- 				}
- 			}
- 			memcpy(oldbuf, newbuf, 17 * 4);
-diff --git a/miner.h b/miner.h
-index ffa20ee..276e765 100644
---- a/miner.h
-+++ b/miner.h
-@@ -351,6 +351,7 @@ struct device_drv {
- 
- 	/* Highest target diff the device supports */
- 	double max_diff;
-+	double working_diff;
- };
- 
- extern struct device_drv *copy_drv(struct device_drv*);
-@@ -485,7 +486,7 @@ struct cgpu_info {
- 	double temp;
- 	int cutofftemp;
- 
--	int64_t diff1;
-+	int diff1;
- 	double diff_accepted;
- 	double diff_rejected;
- 	int last_share_pool;
-@@ -517,11 +518,6 @@ struct cgpu_info {
- 	bool shutdown;
- 
- 	struct timeval dev_start_tv;
--
--	/* For benchmarking only */
--	int hidiff;
--	int lodiff;
--	int direction;
- };
- 
- extern bool add_cgpu(struct cgpu_info*);
-@@ -1013,9 +1009,6 @@ extern char *opt_bitmine_a1_options;
- extern char *opt_bitmain_options;
- extern bool opt_bitmain_hwerror;
- #endif
--#ifdef USE_MINION
--extern char *opt_minion_freq;
--#endif
- #ifdef USE_USBUTILS
- extern char *opt_usb_select;
- extern int opt_usbdump;
-@@ -1117,8 +1110,8 @@ extern double total_rolling;
- extern double total_mhashes_done;
- extern unsigned int new_blocks;
- extern unsigned int found_blocks;
--extern int64_t total_accepted, total_rejected, total_diff1;
--extern int64_t total_getworks, total_stale, total_discarded;
-+extern int total_accepted, total_rejected, total_diff1;;
-+extern int total_getworks, total_stale, total_discarded;
- extern double total_diff_accepted, total_diff_rejected, total_diff_stale;
- extern unsigned int local_work;
- extern unsigned int total_go, total_ro;
-@@ -1159,11 +1152,11 @@ struct stratum_work {
- struct pool {
- 	int pool_no;
- 	int prio;
--	int64_t accepted, rejected;
-+	int accepted, rejected;
- 	int seq_rejects;
- 	int seq_getfails;
- 	int solved;
--	int64_t diff1;
-+	int diff1;
- 	char diff[8];
- 	int quota;
- 	int quota_gcd;
-@@ -1310,8 +1303,7 @@ struct work {
- 	unsigned char	target[32];
- 	unsigned char	hash[32];
- 
--	/* This is the diff the device is currently aiming for and must be
--	 * the minimum of work_difficulty & drv->max_diff */
-+	unsigned char	device_target[32];
- 	double		device_diff;
- 	uint64_t	share_diff;
- 
-@@ -1349,8 +1341,6 @@ struct work {
- 	uint32_t	id;
- 	UT_hash_handle	hh;
- 
--	/* This is the diff work we're aiming to submit and should match the
--	 * work->target binary */
- 	double		work_difficulty;
- 
- 	// Allow devices to identify work if multiple sub-devices
-@@ -1440,11 +1430,7 @@ extern int curses_int(const char *query);
- extern char *curses_input(const char *query);
- extern void kill_work(void);
- extern void switch_pools(struct pool *selected);
--extern void _discard_work(struct work *work);
--#define discard_work(WORK) do { \
--	_discard_work(WORK); \
--	WORK = NULL; \
--} while (0)
-+extern void discard_work(struct work *work);
- extern void remove_pool(struct pool *pool);
- extern void write_config(FILE *fcfg);
- extern void zero_bestshare(void);
-@@ -1454,7 +1440,6 @@ extern bool log_curses_only(int prio, const char *datetime, const char *str);
- extern void clear_logwin(void);
- extern void logwin_update(void);
- extern bool pool_tclear(struct pool *pool, bool *var);
--extern void pool_failed(struct pool *pool);
- extern struct thread_q *tq_new(void);
- extern void tq_free(struct thread_q *tq);
- extern bool tq_push(struct thread_q *tq, void *data);
-@@ -1467,11 +1452,7 @@ extern void app_restart(void);
- extern void roll_work(struct work *work);
- extern struct work *make_clone(struct work *work);
- extern void clean_work(struct work *work);
--extern void _free_work(struct work *work);
--#define free_work(WORK) do { \
--	_free_work(WORK); \
--	WORK = NULL; \
--} while (0)
-+extern void free_work(struct work *work);
- extern void set_work_ntime(struct work *work, int ntime);
- extern struct work *copy_work_noffset(struct work *base_work, int noffset);
- #define copy_work(work_in) copy_work_noffset(work_in, 0)
-@@ -1491,7 +1472,6 @@ enum api_data_type {
- 	API_UINT32,
- 	API_HEX32,
- 	API_UINT64,
--	API_INT64,
- 	API_DOUBLE,
- 	API_ELAPSED,
- 	API_BOOL,
-diff --git a/miner.php b/miner.php
-index 6d4d210..8c3bef3 100644
---- a/miner.php
-+++ b/miner.php
-@@ -1173,11 +1173,7 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 	 */
- 	switch ($name)
- 	{
--	case '0':
--		break;
- 	case 'Last Share Time':
--		if ($section == 'total')
--			break;
- 		if ($section == 'POOL')
- 		{
- 			if ($value == 0)
-@@ -1202,16 +1198,12 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		break;
- 	case 'Last getwork':
- 	case 'Last Valid Work':
--		if ($section == 'total')
--			break;
- 		if ($value == 0)
- 			$ret = 'Never';
- 		else
- 			$ret = ($value - $when) . 's';
- 		break;
- 	case 'Last Share Pool':
--		if ($section == 'total')
--			break;
- 		if ($value == -1)
- 		{
- 			$ret = 'None';
-@@ -1220,8 +1212,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		break;
- 	case 'Elapsed':
- 	case 'Device Elapsed':
--		if ($section == 'total')
--			break;
- 		$s = $value % 60;
- 		$value -= $s;
- 		$value /= 60;
-@@ -1254,8 +1244,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		}
- 		break;
- 	case 'Last Well':
--		if ($section == 'total')
--			break;
- 		if ($value == '0')
- 		{
- 			$ret = 'Never';
-@@ -1265,8 +1253,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 			$ret = date('H:i:s', $value);
- 		break;
- 	case 'Last Not Well':
--		if ($section == 'total')
--			break;
- 		if ($value == '0')
- 			$ret = 'Never';
- 		else
-@@ -1276,8 +1262,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		}
- 		break;
- 	case 'Reason Not Well':
--		if ($section == 'total')
--			break;
- 		if ($value != 'None')
- 			$class = $errorclass;
- 		break;
-@@ -1312,8 +1296,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		$ret = number_format($value, 2).'/m';
- 		break;
- 	case 'Temperature':
--		if ($section == 'total')
--			break;
- 		$ret = $value.'&deg;C';
- 		if (!isset($alldata['GPU']))
- 		{
-@@ -1325,14 +1307,10 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 	case 'Memory Clock':
- 	case 'GPU Voltage':
- 	case 'GPU Activity':
--		if ($section == 'total')
--			break;
- 		if ($value == 0)
- 			$class = $warnclass;
- 		break;
- 	case 'Fan Percent':
--		if ($section == 'total')
--			break;
- 		if ($value == 0)
- 			$class = $warnclass;
- 		else
-@@ -1345,8 +1323,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		}
- 		break;
- 	case 'Fan Speed':
--		if ($section == 'total')
--			break;
- 		if ($value == 0)
- 			$class = $warnclass;
- 		else
-@@ -1437,35 +1413,25 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 		$ret = number_format((float)$parts[0]).$dec;
- 		break;
- 	case 'Status':
--		if ($section == 'total')
--			break;
- 		if ($value != 'Alive')
- 			$class = $errorclass;
- 		break;
- 	case 'Enabled':
--		if ($section == 'total')
--			break;
- 		if ($value != 'Y')
- 			$class = $warnclass;
- 		break;
- 	case 'No Device':
--		if ($section == 'total')
--			break;
- 		if ($value != 'false')
- 			$class = $errorclass;
- 		break;
- 	case 'When':
- 	case 'Current Block Time':
--		if ($section == 'total')
--			break;
- 		$ret = date($dfmt, $value);
- 		break;
--	case 'Last Share Difficulty':
--		if ($section == 'total')
--			break;
- 	case 'Difficulty Accepted':
- 	case 'Difficulty Rejected':
- 	case 'Difficulty Stale':
-+	case 'Last Share Difficulty':
- 		if ($value != '')
- 			$ret = number_format((float)$value, 2);
- 		break;
-@@ -1473,14 +1439,10 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 	case 'Device Rejected%':
- 	case 'Pool Rejected%':
- 	case 'Pool Stale%':
--		if ($section == 'total')
--			break;
- 		if ($value != '')
- 			$ret = number_format((float)$value, 2) . '%';
- 		break;
- 	case 'Best Share':
--		if ($section == 'total')
--			break;
- 	case 'Hardware Errors':
- 		if ($value != '')
- 			$ret = number_format((float)$value);
-@@ -1508,8 +1470,6 @@ function fmt($section, $name, $value, $when, $alldata, $cf = NULL)
- 			$ret = number_format((float)$value, 2);
- 		break;
- 	case 'AvShr':
--		if ($section == 'total')
--			break;
- 		if ($value != '')
- 			$ret = number_format((float)$value, 2);
- 		if ($value == 0)
-@@ -1574,16 +1534,14 @@ function showdatetime()
- #
- global $singlerigsum;
- $singlerigsum = array(
-- 'devs' => array('MHS av' => 1, 'MHS 5s' => 1, 'MHS 1m' => 1, 'MHS 5m' => 1,
--			'MHS 15m' => 1, 'Accepted' => 1, 'Rejected' => 1,
-+ 'devs' => array('MHS av' => 1, 'MHS 5s' => 1, 'Accepted' => 1, 'Rejected' => 1,
- 			'Hardware Errors' => 1, 'Utility' => 1, 'Total MH' => 1,
--			'Diff1 Shares' => 1, 'Diff1 Work' => 1,
--			'Difficulty Accepted' => 1, 'Difficulty Rejected' => 1),
-+			'Diff1 Shares' => 1, 'Diff1 Work' => 1, 'Difficulty Accepted' => 1,
-+			'Difficulty Rejected' => 1),
-  'pools' => array('Getworks' => 1, 'Accepted' => 1, 'Rejected' => 1, 'Discarded' => 1,
- 			'Stale' => 1, 'Get Failures' => 1, 'Remote Failures' => 1,
--			'Diff1 Shares' => 1, 'Diff1 Work' => 1,
--			'Difficulty Accepted' => 1, 'Difficulty Rejected' => 1,
--			'Difficulty Stale' => 1),
-+			'Diff1 Shares' => 1, 'Diff1 Work' => 1, 'Difficulty Accepted' => 1,
-+			'Difficulty Rejected' => 1, 'Difficulty Stale' => 1),
-  'notify' => array('*' => 1));
- #
- function showtotal($total, $when, $oldvalues)
-diff --git a/usbutils.c b/usbutils.c
-index 3882507..a0cf1d2 100644
---- a/usbutils.c
-+++ b/usbutils.c
-@@ -159,13 +159,13 @@ static struct usb_intinfo bxf_ints[] = {
- 	USB_EPS(0,  bxf0_epinfos)
- };
- 
--static struct usb_epinfo nfu_epinfos[] = {
-+static struct usb_epinfo nf1_epinfos[] = {
- 	{ LIBUSB_TRANSFER_TYPE_INTERRUPT,	64,	EPI(1), 0, 0 },
- 	{ LIBUSB_TRANSFER_TYPE_INTERRUPT,	64,	EPO(1), 0, 0 },
- };
- 
--static struct usb_intinfo nfu_ints[] = {
--	USB_EPS(0, nfu_epinfos)
-+static struct usb_intinfo nf1_ints[] = {
-+	USB_EPS(0, nf1_epinfos)
- };
- 
- static struct usb_epinfo bxm_epinfos[] = {
-@@ -415,27 +415,14 @@ static struct usb_find_devices find_dev[] = {
- 	},
- 	{
- 		.drv = DRIVER_bitfury,
--		.name = "OSM",
--		.ident = IDENT_OSM,
--		.idVendor = 0x198c,
--		.idProduct = 0xb1f1,
--		.config = 1,
--		.timeout = BITFURY_TIMEOUT_MS,
--		.latency = LATENCY_UNUSED,
--		.iManufacturer = "c-scape",
--		.iProduct = "OneString",
--		INTINFO(bxf_ints)
--	},
--	{
--		.drv = DRIVER_bitfury,
--		.name = "NFU",
--		.ident = IDENT_NFU,
-+		.name = "NF1",
-+		.ident = IDENT_NF1,
- 		.idVendor = 0x04d8,
- 		.idProduct = 0x00de,
- 		.config = 1,
- 		.timeout = BITFURY_TIMEOUT_MS,
- 		.latency = LATENCY_UNUSED,
--		INTINFO(nfu_ints)
-+		INTINFO(nf1_ints)
- 	},
- 	{
- 		.drv = DRIVER_bitfury,
-diff --git a/usbutils.h b/usbutils.h
-index 7f51186..b05882e 100644
---- a/usbutils.h
-+++ b/usbutils.h
-@@ -158,8 +158,7 @@ enum sub_ident {
- 	IDENT_KLN,
- 	IDENT_LLT,
- 	IDENT_MMQ,
--	IDENT_NFU,
--	IDENT_OSM
-+	IDENT_NF1
- };
- 
- struct usb_find_devices {
-@@ -377,8 +376,6 @@ struct cg_usb_info {
- 	USB_ADD_COMMAND(C_BXF_MAXROLL, "BXFMaxRoll") \
- 	USB_ADD_COMMAND(C_BXF_FLUSH, "BXFFlush") \
- 	USB_ADD_COMMAND(C_BXF_CLOCK, "BXFClock") \
--	USB_ADD_COMMAND(C_BXF_LEDMODE, "BXFLedMode") \
--	USB_ADD_COMMAND(C_BXF_DEBUGMODE, "BXFDebugMode") \
-=======
+ }
+ 
 @@ -1087,6 +1166,7 @@ static bool bitfury_prepare(struct thr_info *thr)
  
  	switch(info->ident) {

+ */
+
+
>>>>>>> Stashed changes
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <string.h>

+cgminer_SOURCES += A1-board-selector.h
+cgminer_SOURCES += A1-board-selector-CCD.c A1-board-selector-CCR.c
+cgminer_SOURCES += A1-trimpot-mcp4x.h A1-trimpot-mcp4x.c
 endif
 
 if HAS_DRILLBIT
diff --git a/NEWS b/NEWS
index eec6a3d..43b63e2 100644
--- a/NEWS
+++ b/NEWS
