Merge branch 'master' into feature/mbedtls
This commit is contained in:
		
						commit
						8a470e6f98
					
				
					 5 changed files with 13 additions and 13 deletions
				
			
		| 
						 | 
					@ -30,13 +30,13 @@ static xQueueHandle mainqueue;
 | 
				
			||||||
static xTimerHandle timerHandle;
 | 
					static xTimerHandle timerHandle;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Own BMP180 User Inform Implementation
 | 
					// Own BMP180 User Inform Implementation
 | 
				
			||||||
bool bmp180_i2c_informUser(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperatue, bmp180_press_t pressure)
 | 
					bool bmp180_i2c_informUser(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    my_event_t ev;
 | 
					    my_event_t ev;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ev.event_type = MY_EVT_BMP180;
 | 
					    ev.event_type = MY_EVT_BMP180;
 | 
				
			||||||
    ev.bmp180_data.cmd = cmd;
 | 
					    ev.bmp180_data.cmd = cmd;
 | 
				
			||||||
    ev.bmp180_data.temperatue = temperatue;
 | 
					    ev.bmp180_data.temperature = temperature;
 | 
				
			||||||
    ev.bmp180_data.pressure = pressure;
 | 
					    ev.bmp180_data.pressure = pressure;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return (xQueueSend(*resultQueue, &ev, 0) == pdTRUE);
 | 
					    return (xQueueSend(*resultQueue, &ev, 0) == pdTRUE);
 | 
				
			||||||
| 
						 | 
					@ -74,7 +74,7 @@ void bmp180_task(void *pvParameters)
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        case MY_EVT_BMP180:
 | 
					        case MY_EVT_BMP180:
 | 
				
			||||||
            printf("%s: Received BMP180 Event temp:=%d.%d°C press=%d.%02dhPa\n", __FUNCTION__, \
 | 
					            printf("%s: Received BMP180 Event temp:=%d.%d°C press=%d.%02dhPa\n", __FUNCTION__, \
 | 
				
			||||||
                       (int32_t)ev.bmp180_data.temperatue, abs((int32_t)(ev.bmp180_data.temperatue*10)%10), \
 | 
					                       (int32_t)ev.bmp180_data.temperature, abs((int32_t)(ev.bmp180_data.temperature*10)%10), \
 | 
				
			||||||
                       ev.bmp180_data.pressure/100, ev.bmp180_data.pressure%100 );
 | 
					                       ev.bmp180_data.pressure/100, ev.bmp180_data.pressure%100 );
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,7 +72,7 @@ private:
 | 
				
			||||||
            uint32_t count;
 | 
					            uint32_t count;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if(queue.receive(count, 1500) == 0) {
 | 
					            if(queue.receive(count, 1500) == 0) {
 | 
				
			||||||
                printf("task_2_t::task(): got %lu\n", count);
 | 
					                printf("task_2_t::task(): got %u\n", count);
 | 
				
			||||||
            } 
 | 
					            } 
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                printf("task_2_t::task(): no msg\n");
 | 
					                printf("task_2_t::task(): no msg\n");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,7 @@ public:
 | 
				
			||||||
  Counter(uint32_t initial_count)
 | 
					  Counter(uint32_t initial_count)
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    this->_count = initial_count;
 | 
					    this->_count = initial_count;
 | 
				
			||||||
    printf("Counter initialised with count %ld\r\n", initial_count);
 | 
					    printf("Counter initialised with count %d\r\n", initial_count);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void Increment()
 | 
					  void Increment()
 | 
				
			||||||
| 
						 | 
					@ -50,7 +50,7 @@ void task1(void *pvParameters)
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    counter->Increment();
 | 
					    counter->Increment();
 | 
				
			||||||
    printf("local counter %ld static counter %ld newly allocated counter %ld\r\n", local_counter.getCount(),
 | 
					    printf("local counter %d static counter %d newly allocated counter %d\r\n", local_counter.getCount(),
 | 
				
			||||||
	   static_counter.getCount(), new_counter->getCount());
 | 
						   static_counter.getCount(), new_counter->getCount());
 | 
				
			||||||
    vTaskDelay(100);
 | 
					    vTaskDelay(100);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -75,10 +75,10 @@ static int16_t  MD;
 | 
				
			||||||
// Forward declarations
 | 
					// Forward declarations
 | 
				
			||||||
//
 | 
					//
 | 
				
			||||||
static void bmp180_meassure(const bmp180_command_t* command);
 | 
					static void bmp180_meassure(const bmp180_command_t* command);
 | 
				
			||||||
static bool bmp180_informUser_Impl(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperatue, bmp180_press_t pressure);
 | 
					static bool bmp180_informUser_Impl(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Set default implementation .. User gets result as bmp180_result_t event
 | 
					// Set default implementation .. User gets result as bmp180_result_t event
 | 
				
			||||||
bool (*bmp180_informUser)(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperatue, bmp180_press_t pressure) = bmp180_informUser_Impl;
 | 
					bool (*bmp180_informUser)(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure) = bmp180_informUser_Impl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// I2C Driver Task
 | 
					// I2C Driver Task
 | 
				
			||||||
static void bmp180_driver_task(void *pvParameters)
 | 
					static void bmp180_driver_task(void *pvParameters)
 | 
				
			||||||
| 
						 | 
					@ -279,12 +279,12 @@ static void bmp180_meassure(const bmp180_command_t* command)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Default user inform implementation
 | 
					// Default user inform implementation
 | 
				
			||||||
static bool bmp180_informUser_Impl(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperatue, bmp180_press_t pressure)
 | 
					static bool bmp180_informUser_Impl(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    bmp180_result_t result;
 | 
					    bmp180_result_t result;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    result.cmd = cmd;
 | 
					    result.cmd = cmd;
 | 
				
			||||||
    result.temperatue = temperatue;
 | 
					    result.temperature = temperature;
 | 
				
			||||||
    result.pressure = pressure;
 | 
					    result.pressure = pressure;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return (xQueueSend(*resultQueue, &result, 0) == pdTRUE);
 | 
					    return (xQueueSend(*resultQueue, &result, 0) == pdTRUE);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,7 +33,7 @@ typedef uint32_t bmp180_press_t;
 | 
				
			||||||
typedef struct
 | 
					typedef struct
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    uint8_t cmd;
 | 
					    uint8_t cmd;
 | 
				
			||||||
    bmp180_temp_t  temperatue;
 | 
					    bmp180_temp_t  temperature;
 | 
				
			||||||
    bmp180_press_t pressure;
 | 
					    bmp180_press_t pressure;
 | 
				
			||||||
} bmp180_result_t;
 | 
					} bmp180_result_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -50,6 +50,6 @@ void bmp180_trigger_temperature_measurement(const xQueueHandle* resultQueue);
 | 
				
			||||||
void bmp180_trigger_pressure_measurement(const xQueueHandle* resultQueue);
 | 
					void bmp180_trigger_pressure_measurement(const xQueueHandle* resultQueue);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Give the user the chance to create it's own handler
 | 
					// Give the user the chance to create it's own handler
 | 
				
			||||||
extern bool (*bmp180_informUser)(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperatue, bmp180_press_t pressure);
 | 
					extern bool (*bmp180_informUser)(const xQueueHandle* resultQueue, uint8_t cmd, bmp180_temp_t temperature, bmp180_press_t pressure);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* DRIVER_BMP180_H_ */
 | 
					#endif /* DRIVER_BMP180_H_ */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue