NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mock_system.cc File Reference
#include <stdint.h>
#include "platform.h"
#include "drivers/system.h"
#include "ninja.h"
#include <stdio.h>
#include <time.h>
#include <string.h>
#include "unittest_macros.h"
#include "gtest/gtest.h"
Include dependency graph for mock_system.cc:

Data Structures

struct  syscalls
 

Macros

#define MOCK_EEPROM_MAX_SIZE   4096
 

Functions

void _write_motor (const struct system_calls_pwm *pwm, uint8_t id, uint16_t value)
 
void _write_servo (const struct system_calls_pwm *pwm, uint8_t id, uint16_t value)
 
uint16_t _read_pwm (const struct system_calls_pwm *pwm, uint8_t id)
 
uint16_t _read_ppm (const struct system_calls_pwm *pwm, uint8_t id)
 
const struct system_callsmock_syscalls ()
 
void ninja_config_reset (struct ninja *self)
 
void mock_eeprom_erase ()
 
void mock_system_reset ()
 

Variables

uint16_t mock_motor_pwm [8]
 
uint16_t mock_servo_pwm [8]
 
uint16_t mock_rc_pwm [RX_MAX_SUPPORTED_RC_CHANNELS]
 
uint16_t mock_pwm_errors = 0
 
int16_t mock_acc [3]
 
int16_t mock_gyro [3]
 
uint32_t mock_eeprom_written = 0
 
uint16_t mock_eeprom_pages = 2
 
uint16_t mock_eeprom_page_size = 512
 
uint8_t mock_eeprom_erase_byte = 0xff
 
char mock_eeprom_data [MOCK_EEPROM_MAX_SIZE]
 
uint16_t cycleTime
 

Macro Definition Documentation

#define MOCK_EEPROM_MAX_SIZE   4096

Function Documentation

uint16_t _read_ppm ( const struct system_calls_pwm pwm,
uint8_t  id 
)
uint16_t _read_pwm ( const struct system_calls_pwm pwm,
uint8_t  id 
)
void _write_motor ( const struct system_calls_pwm pwm,
uint8_t  id,
uint16_t  value 
)
void _write_servo ( const struct system_calls_pwm pwm,
uint8_t  id,
uint16_t  value 
)
void mock_eeprom_erase ( )
const struct system_calls* mock_syscalls ( )
void mock_system_reset ( )
void ninja_config_reset ( struct ninja self)

Here is the call graph for this function:

Variable Documentation

uint16_t cycleTime
int16_t mock_acc[3]
char mock_eeprom_data[MOCK_EEPROM_MAX_SIZE]
uint8_t mock_eeprom_erase_byte = 0xff
uint16_t mock_eeprom_page_size = 512
uint16_t mock_eeprom_pages = 2
uint32_t mock_eeprom_written = 0
int16_t mock_gyro[3]
uint16_t mock_motor_pwm[8]
uint16_t mock_pwm_errors = 0
uint16_t mock_rc_pwm[RX_MAX_SUPPORTED_RC_CHANNELS]
uint16_t mock_servo_pwm[8]