Skip to content

Commit

Permalink
Added Makefile
Browse files Browse the repository at this point in the history
Compiler warning fixes
  • Loading branch information
Simo Bergman committed Apr 14, 2015
1 parent 870088e commit 7b1599b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions MIT-LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2010 Bogdan Marinescu
Copyright (c) 2015 Simo Bergman

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# Copyright (c) 2015 Simo Bergman

CC=gcc
EXE=stm32ld
OBJ=main.o serial_posix.o stm32ld.o
CFLAGS= -Wall

all: $(EXE)

$(EXE):$(OBJ)

clean:
rm -f $(OBJ) $(EXE)
4 changes: 2 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ int main( int argc, const char **argv )
printf( "Found bootloader version: %d.%d\n", major, minor );
if( BL_MKVER( major, minor ) < BL_MINVERSION )
{
fprintf( stderr, "Unsupported bootloader version" );
fprintf( stderr, "Unsupported bootloader version\n" );
exit( 1 );
}
}
Expand All @@ -128,7 +128,7 @@ int main( int argc, const char **argv )
printf( "Chip ID: %04X\n", version );
if( version != CHIP_ID && version != CHIP_ID_ALT )
{
fprintf( stderr, "Unsupported chip ID" );
fprintf( stderr, "Unsupported chip ID\n" );
exit( 1 );
}
}
Expand Down
3 changes: 1 addition & 2 deletions stm32ld.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// STM32 bootloader client

#include <stdio.h>
#include <unistd.h>
#include "serial.h"
#include "type.h"
#include "stm32ld.h"
Expand Down Expand Up @@ -102,7 +103,6 @@ int stm32_get_version( u8 *major, u8 *minor )
{
u8 i, version;
int temp, total;
int tries = STM32_RETRY_COUNT;

STM32_CHECK_INIT;
stm32h_send_command( STM32_CMD_GET_COMMAND );
Expand All @@ -123,7 +123,6 @@ int stm32_get_version( u8 *major, u8 *minor )
// Get chip ID
int stm32_get_chip_id( u16 *version )
{
u8 temp;
int vh, vl;

STM32_CHECK_INIT;
Expand Down
2 changes: 2 additions & 0 deletions stm32ld.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ int stm32_write_unprotect();
int stm32_erase_flash();
int stm32_write_flash( p_read_data read_data_func, p_progress progress_func );
int stm32_go_command( void );
int stm32_get_version( u8 *major, u8 *minor );
int stm32_extended_erase_flash();

#endif

0 comments on commit 7b1599b

Please sign in to comment.