Initial commit
authorThomas Pietrzak <thomas.pietrzak@gmail.com>
Fri, 18 Oct 2013 21:16:22 +0000 (21:16 +0000)
committerThomas Pietrzak <thomas.pietrzak@gmail.com>
Fri, 18 Oct 2013 21:16:22 +0000 (21:16 +0000)
git-svn-id: svn+ssh://thomaspietrzak.com/var/svn/rep@114 47cf9a05-e0a8-4ed5-9e9b-101a649bc004

test.c [deleted file]

diff --git a/test.c b/test.c
deleted file mode 100644 (file)
index 6ce1f48..0000000
--- a/test.c
+++ /dev/null
@@ -1,101 +0,0 @@
-#include <FreeRTOS.h>
-#include <task.h>
-#include <stdio.h>
-#include <malloc_wrapper.h>
-
-#include <stm32f10x_gpio.h>
-#include <stm32f10x_rcc.h>
-#include <stm32f10x_i2c.h>
-
-#define LSM_I2C_Speed 400000
-
-//LSM303DLHC geomagnetic module is talking on I2C2
-void initMagneto()
-{
-  //enable GPIO clocks
-  RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO, ENABLE);
-  RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C2, ENABLE);
-
-  // SCL => PB10
-  // SDA => PB11
-  GPIO_InitTypeDef i2cpinsdef;
-  i2cpinsdef.GPIO_Pin = GPIO_Pin_10 | GPIO_Pin_11;
-  i2cpinsdef.GPIO_Speed = GPIO_Speed_50MHz;
-  i2cpinsdef.GPIO_Mode = GPIO_Mode_AF_OD;
-  GPIO_Init(GPIOB, &i2cpinsdef);
-
-  // Connect I2C1 pins to AF  
-  GPIO_PinAFConfig(GPIOB, GPIO_PinSource6, GPIO_AF_I2C1);      // SCL
-  GPIO_PinAFConfig(GPIOB, GPIO_PinSource7, GPIO_AF_I2C1); // SDA
-
-  I2C_InitTypeDef i2cdef;
-  i2cdef.I2C_ClockSpeed = LSM_I2C_Speed;
-  i2cdef.I2C_Mode = I2C_Mode_I2C;
-  i2cdef.I2C_DutyCycle = I2C_DutyCycle_2;
-  i2cdef.I2C_OwnAddress1 = 0x00;
-  i2cdef.I2C_Ack = I2C_Ack_Enable;
-  i2cdef.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;
-  I2C_Init(I2Cx, &i2cdef);
-  I2C_Cmd(I2Cx, ENABLE);
-}
-
-void initLed()
-{
-  //set Pin22 (PA4) to output mode
-  GPIO_InitTypeDef pin22def;
-  pin22def.GPIO_Pin = GPIO_Pin_4;
-  pin22def.GPIO_Speed = GPIO_Speed_50MHz;
-  pin22def.GPIO_Mode = GPIO_Mode_Out_PP;
-  GPIO_Init(GPIOA, &pin22def);
-}
-
-void setLed()
-{
-  GPIO_WriteBit(GPIOA, GPIO_Pin_4, Bit_SET);
-}
-
-void resetLed()
-{
-  GPIO_WriteBit(GPIOA, GPIO_Pin_4, Bit_RESET);
-}
-
-void sleep(int duration)
-{
-       int i;
-       for(i = 0 ; i < 1000 * duration ; i++);
-}
-
-static void blinkerTask(void *p) 
-{
-  while (1) 
-  {
-     setLed();
-     vTaskDelay(1357);
-     resetLed(); 
-     vTaskDelay(1357);
-  }
-}
-
-int main() 
-{
-  init_malloc_wrapper();
-  initLed();
-  initMagneto();
-  setLed();
-
-  //start a task
-  xTaskCreate(blinkerTask, (const char *)NULL, configMINIMAL_STACK_SIZE, (void *)NULL, tskIDLE_PRIORITY, NULL);
-
-  //start task scheduler
-  vTaskStartScheduler();
-
-  return 0;
-}
-
-/*  while(1)
-  {
-        setLed();
-        sleep(1000);
-        resetLed();
-        sleep(1000);
-  }*/