Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 2:415e979c52cf, committed 2020-01-10
- Comitter:
- hudakz
- Date:
- Fri Jan 10 21:03:00 2020 +0000
- Parent:
- 1:9231777638b6
- Child:
- 3:f2e67488f5ab
- Commit message:
- Barcode reader with a TCD1304AP TOSHIBA CCD linear image sensor and NUCLEO-F103RB board.
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Jan 10 20:46:23 2020 +0000
+++ b/main.cpp Fri Jan 10 21:03:00 2020 +0000
@@ -22,7 +22,6 @@
using namespace zbar;
//#define TEST_DECODER // Uncomment to carry out a decoder test
-
#define DATA_LEN 3694
#define MARGIN_LEFT 32
#define MARGIN_RIGHT 14
@@ -36,7 +35,6 @@
virtual ~Handler() { }
virtual void decode_callback(Decoder& decoder)
{
- printf("handler called\r\n");
if (decoder.get_type() <= ZBAR_PARTIAL) {
return;
}
@@ -50,13 +48,12 @@
TIM_HandleTypeDef htim1;
TIM_HandleTypeDef htim2;
TIM_HandleTypeDef htim3;
-Serial pc(USBTX, USBRX);
DigitalOut led(LED1);
DigitalIn btn(USER_BUTTON);
uint16_t adcData[DATA_LEN];
volatile bool adcDmaStarted = false;
volatile bool adcDataAvailable = false;
-volatile bool ledIsOn = false; // Use this rather than the 'led' variable to make ISR's as fast as possible
+volatile bool ledIsOn = false; // Use this rather than the 'led' variable to make ISR as fast as possible
Decoder* decoder;
Handler* handler;
Scanner* scanner;
@@ -95,12 +92,6 @@
adcDataAvailable = true;
}
-/**
- * @brief
- * @note
- * @param
- * @retval
- */
#ifdef TEST_DECODER
/**
@@ -158,7 +149,6 @@
scanner = new Scanner(decoder);
decoder->set_handler(*handler);
decoder->set_config(ZBAR_NONE, ZBAR_CFG_MIN_LEN, 0);
- adcDataAvailable = 0;
while (1) {
if ((btn == 0) && !ledIsOn) {