Skip to content

Commit

Permalink
placed assert macro where it belongs #49
Browse files Browse the repository at this point in the history
  • Loading branch information
SergNikitin committed May 17, 2014
1 parent 62279fa commit 89f5f03
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
9 changes: 0 additions & 9 deletions firmware/SatStepperBegin/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
#ifndef _GLOBAL_STATE_H_
#define _GLOBAL_STATE_H_

#define __ASSERT_CONCAT(a, b) a##b
#define STATIC_ASSERT(e) \
enum { __ASSERT_CONCAT(static_assert_, __LINE__) = 1/(!!(e)) }

#define ASSERT(condition, event) \
if (condition) { \
event; \
}

#include <stdint.h>
#include "algo_types.h"
#include "control_algo.h"
Expand Down
15 changes: 12 additions & 3 deletions firmware/SatStepperBegin/utils/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* ========================================================
*/

#ifndef _MACROS_H_
#define _MACROS_H_
#ifndef _MACROS__H_
#define _MACROS__H_

#define CPU_CLOCK_SPEED 6.000L // for 60 Mhz; 10.000L for a 100MHz CPU clock speed
#define ADC_usDELAY 10000L
Expand All @@ -22,6 +22,15 @@ extern void DSP28x_usDelay(unsigned long Count);
#define ACKNOWLEDGE_ONE_MORE_INTERRUPT_FROM_GROUP(GROUP_ID) \
PieCtrlRegs.PIEACK.all = GROUP_ID

#define __ASSERT_CONCAT(a, b) a##b
#define STATIC_ASSERT(e) \
enum { __ASSERT_CONCAT(static_assert_, __LINE__) = 1/(!!(e)) }

#define ASSERT(condition, event) \
if (condition) { \
event; \
}

#define PI 3.14159265358979

#endif //_MACROS_H_
#endif //_MACROS__H_

0 comments on commit 89f5f03

Please sign in to comment.