Cannot download The examples from "Getting Started with the Photon"

I just bought the Photon and the book "Getting Started with the Photon"
My Photon is connected (online) and connected to my computer and I’ve successfully download simple programs that doesn’t require any external libraries.
However - When I tried the example p_10_Thermometer_Dallas and tried to download it I got a long list of error messages which I have pasted below. (The code Compile OK)

What did I do wrong ?

thanks,
rssorensen

In file included from /spark/compile_service/shared/workspace/6_hal_12_0/firmware-privap_10_thermometer_dallas.cpp:2:0:
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.h:31:0: warning: "FALSE" redefined [enabled by default]
#define FALSE 0
^
In file included from ../wiring/inc/spark_wiring.h:37:0,
from ./inc/application.h:29,
from /spark/compile_service/shared/workspace/6_hal_12_0/firmware-privap_10_thermometer_dallas.cpp:3:
../wiring/inc/spark_wiring_constants.h:62:0: note: this is the location of the previous definition
#define FALSE (0x00)
^
In file included from /spark/compile_service/shared/workspace/6_hal_12_0/firmware-privap_10_thermometer_dallas.cpp:2:0:
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.h:32:0: warning: "TRUE" redefined [enabled by default]
#define TRUE 1
^
In file included from ../wiring/inc/spark_wiring.h:37:0,
from ./inc/application.h:29,
from /spark/compile_service/shared/workspace/6_hal_12_0/firmware-privap_10_thermometer_dallas.cpp:3:
../wiring/inc/spark_wiring_constants.h:65:0: note: this is the location of the previous definition
#define TRUE (!FALSE)
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In constructor 'OneWire::OneWire(uint16_t)':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:135:15: error: 'INPUT' was not declared in this scope
pinMode(pin, INPUT);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:135:20: error: 'pinMode' was not declared in this scope
pinMode(pin, INPUT);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_WRITE_LOW()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:142:1: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_MODE_OUTPUT()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:146:1: error: 'GPIO_TypeDef' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:146:15: error: 'gpio_port' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:146:27: error: 'PIN_MAP' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:149:9: error: 'GPIO_InitTypeDef' was not declared in this scope
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:149:26: error: expected ';' before 'GPIO_InitStructure'
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:151:26: error: 'GPIOA' was not declared in this scope
if (gpio_port == GPIOA )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:153:40: error: 'RCC_APB2Periph_GPIOA' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:153:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:153:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:155:31: error: 'GPIOB' was not declared in this scope
else if (gpio_port == GPIOB )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:157:40: error: 'RCC_APB2Periph_GPIOB' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:157:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:157:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:160:5: error: 'GPIO_InitStructure' was not declared in this scope
GPIO_InitStructure.GPIO_Pin = gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:161:33: error: 'GPIO_Mode_Out_PP' was not declared in this scope
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:162:34: error: 'GPIO_Speed_50MHz' was not declared in this scope
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:163:30: error: 'OUTPUT' was not declared in this scope
PIN_MAP[_pin].pin_mode = OUTPUT;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:164:45: error: 'GPIO_Init' was not declared in this scope
GPIO_Init(gpio_port, &GPIO_InitStructure);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_WRITE_HIGH()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:168:1: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_MODE_INPUT()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:172:2: error: 'GPIO_TypeDef' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:172:16: error: 'gpio_port' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:172:28: error: 'PIN_MAP' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:175:9: error: 'GPIO_InitTypeDef' was not declared in this scope
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:175:26: error: expected ';' before 'GPIO_InitStructure'
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:177:26: error: 'GPIOA' was not declared in this scope
if (gpio_port == GPIOA )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:179:40: error: 'RCC_APB2Periph_GPIOA' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:179:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:179:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:181:31: error: 'GPIOB' was not declared in this scope
else if (gpio_port == GPIOB )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:183:40: error: 'RCC_APB2Periph_GPIOB' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:183:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:183:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:186:5: error: 'GPIO_InitStructure' was not declared in this scope
GPIO_InitStructure.GPIO_Pin = gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:187:33: error: 'GPIO_Mode_IN_FLOATING' was not declared in this scope
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:188:30: error: 'INPUT' was not declared in this scope
PIN_MAP[_pin].pin_mode = INPUT;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:189:41: error: 'GPIO_Init' was not declared in this scope
GPIO_Init(gpio_port, &GPIO_InitStructure);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'uint8_t OneWire::DIRECT_READ()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:193:30: error: 'PIN_MAP' was not declared in this scope
return GPIO_ReadInputDataBit(PIN_MAP[_pin].gpio_peripheral, PIN_MAP[_pin].gpio_pin);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:193:83: error: 'GPIO_ReadInputDataBit' was not declared in this scope
return GPIO_ReadInputDataBit(PIN_MAP[_pin].gpio_peripheral, PIN_MAP[_pin].gpio_pin);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'uint8_t OneWire::reset()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:208:15: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:210:13: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:214:22: error: 'delayMicroseconds' was not declared in this scope
delayMicroseconds(2);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:221:23: error: 'delayMicroseconds' was not declared in this scope
delayMicroseconds(480);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::write_bit(uint8_t)':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:235:16: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:238:23: error: 'delayMicroseconds' was not declared in this scope
delayMicroseconds(10);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:240:14: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:243:16: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:246:23: error: 'delayMicroseconds' was not declared in this scope
delayMicroseconds(65);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:248:14: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'uint8_t OneWire::read_bit()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:262:15: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:265:21: error: 'delayMicroseconds' was not declared in this scope
delayMicroseconds(3);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:269:13: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::write(uint8_t, uint8_t)':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:288:15: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:291:13: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::write_bytes(const uint8_t*, uint16_t, bool)':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:299:18: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:302:16: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::depower()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:346:15: error: 'noInterrupts' was not declared in this scope
noInterrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:348:13: error: 'interrupts' was not declared in this scope
interrupts();
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'uint8_t OneWire::DIRECT_READ()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:194:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make[1]: *** [../build/target/user/platform-6OneWire/OneWire.o] Error 1
make: *** [user] Error 2

It looks like the OneWire library is forcibly defining FALSE even though it’s already defined.

This was recently added to our wiring API because it was present on the core from the CC3000 library. Some people were using this for existing code and requested that we keep it for the photon also, so TRUE and FALSE have been moved into Wiring.

So we can either remove it from Wiring, or fix the OneWire code so that it only defines FALSE if it’s not already defined. Like this:

#ifndef FALSE
#define FALSE 0
#define TRUE !FALSE
#endif

Thanks mdma

OK. I can see that his might take care of some of the warnings but what about the errors?
There appear to be a OneWireSpark version on Github in which these DEFINE has been removed.
Is there a way to use this library instead with the Web IDE?

thanks,

I am having the same issue. Code that complies fine on the Core kicks out all sorts of errors wrt the OneWire library on the Photon.

/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_WRITE_LOW()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:142:1: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_pin].gpio_peripheral->BRR = PIN_MAP[_pin].gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_MODE_OUTPUT()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:146:1: error: 'GPIO_TypeDef' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:146:15: error: 'gpio_port' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:146:27: error: 'PIN_MAP' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:149:9: error: 'GPIO_InitTypeDef' was not declared in this scope
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:149:26: error: expected ';' before 'GPIO_InitStructure'
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:151:26: error: 'GPIOA' was not declared in this scope
if (gpio_port == GPIOA )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:153:40: error: 'RCC_APB2Periph_GPIOA' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:153:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:153:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:155:31: error: 'GPIOB' was not declared in this scope
else if (gpio_port == GPIOB )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:157:40: error: 'RCC_APB2Periph_GPIOB' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:157:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:157:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:160:5: error: 'GPIO_InitStructure' was not declared in this scope
GPIO_InitStructure.GPIO_Pin = gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:161:33: error: 'GPIO_Mode_Out_PP' was not declared in this scope
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:162:34: error: 'GPIO_Speed_50MHz' was not declared in this scope
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:164:45: error: 'GPIO_Init' was not declared in this scope
GPIO_Init(gpio_port, &GPIO_InitStructure);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_WRITE_HIGH()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:168:1: error: 'PIN_MAP' was not declared in this scope
PIN_MAP[_pin].gpio_peripheral->BSRR = PIN_MAP[_pin].gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'void OneWire::DIRECT_MODE_INPUT()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:172:2: error: 'GPIO_TypeDef' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:172:16: error: 'gpio_port' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:172:28: error: 'PIN_MAP' was not declared in this scope
GPIO_TypeDef *gpio_port = PIN_MAP[_pin].gpio_peripheral;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:175:9: error: 'GPIO_InitTypeDef' was not declared in this scope
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:175:26: error: expected ';' before 'GPIO_InitStructure'
GPIO_InitTypeDef GPIO_InitStructure;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:177:26: error: 'GPIOA' was not declared in this scope
if (gpio_port == GPIOA )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:179:40: error: 'RCC_APB2Periph_GPIOA' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:179:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:179:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:181:31: error: 'GPIOB' was not declared in this scope
else if (gpio_port == GPIOB )
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:183:40: error: 'RCC_APB2Periph_GPIOB' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:183:62: error: 'ENABLE' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:183:68: error: 'RCC_APB2PeriphClockCmd' was not declared in this scope
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:186:5: error: 'GPIO_InitStructure' was not declared in this scope
GPIO_InitStructure.GPIO_Pin = gpio_pin;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:187:33: error: 'GPIO_Mode_IN_FLOATING' was not declared in this scope
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:189:41: error: 'GPIO_Init' was not declared in this scope
GPIO_Init(gpio_port, &GPIO_InitStructure);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp: In member function 'uint8_t OneWire::DIRECT_READ()':
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:193:30: error: 'PIN_MAP' was not declared in this scope
return GPIO_ReadInputDataBit(PIN_MAP[_pin].gpio_peripheral, PIN_MAP[_pin].gpio_pin);
^
/spark/compile_service/shared/workspace/6_hal_12_0/firmware-privaOneWire/OneWire.cpp:193:83: error: 'GPIO_ReadInputDataBit' was not declared in this scope
return GPIO_ReadInputDataBit(PIN_MAP[_pin].gpio_peripheral, PIN_MAP[_pin].gpio_pin);

There are some threads dealing with this problem already

Have a look here

and here

1 Like

Those post explain the issue. ScuffR, thanks for the pointer to them. It looks like the modifications in the above posts will need to be applied to the OneWire.cpp file to make the library compatible with the photon. I forked the OneWire library and tried to apply the patch, so far no luck though. I will keep this list posted if I have forward progress.

1 Like

See Libraries to Update for the Photon